Breaking x-axis into bins and extracting max value corresponding y-axis
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I am working with force curves, and I am analyzing these curves as force over a percentage of time (i.e., 0-100%). I have two questions:
1) How do I break my x-axis into 10 equal bins 0-10%, 10%-20%, 20-30%, etc.
2) How do I find a single value on the Y-axis (i.e., max) for each bin (see photo)?
Thanks,
Michael
0 个评论
回答(1 个)
Image Analyst
2015-2-18
To find the max in each 10%, assuming that your signal vector Y is a multiple of 10 long
numberOfElements = length(Y);
reshapedY = reshape(Y, [10, numberOfElements /10]);
maxInEachTenth = max(reshapedY, [], 1);
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!