Breaking x-axis into bins and extracting max value corresponding y-axis

1 view (last 30 days)
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

Answers (1)

Image Analyst
Image Analyst on 18 Feb 2015
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);

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!