How can I specify the width of Bin Edges when calculating the rainflow cycle counts matrix 'c = rainflow(x)'
22 views (last 30 days)
Show older comments
Dear Madam/Sir,
How can I specify the width of Bin Edges when calculating the rainflow cycle counts matrix 'c = rainflow(x)' ?
After computing the cycle counts for the data, using the command: [c,hist,edges,rmm,idx] = rainflow(Y) , I plot a histogram of cycle counts as a function of stress range, using the command: histogram('BinEdges',edges','BinCounts',sum(hist,2)) , as indicated in the example of the Matlab Documentation: https://ch.mathworks.com/help/signal/ref/rainflow.html#d120e139233
It seems that the 'Bin Edges' are assigned an arbitrary width value. Instead, I would like to assign a specific width value to the Bin Edges, while ploting the histogram of the cycle counts, resulting from the cycle counts matrix 'rainflow(x)'.
Could you please help me, how can I specify the width of Bin Edges when calculating the rainflow cycle counts matrix 'c = rainflow(x)' ?
Thank you very much in advance for your help
Best regards,
Geri
5 Comments
Sandro Günter
on 10 Aug 2022
Edited: Sandro Günter
on 10 Aug 2022
However, it counts the half cycles as full ones.
Another way is to change the code of the rainflow function itself as suggested here: https://stackoverflow.com/questions/52513809/reduce-bin-size-for-matlab-rainflow-counting
Sandro Günter
on 10 Aug 2022
Edited: Sandro Günter
on 11 Aug 2022
In order to count the half cycles correctly, you can add the following code:
index = find(count(:,1)==0.5); % find half cycles
N = N - 0.5 * histcounts(count(index,2),my_edges); % subtract half cycles
Answers (0)
See Also
Categories
Find more on Vibration Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!