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

조회 수: 1 (최근 30일)
Michael
Michael 2015년 2월 18일
답변: Image Analyst 2015년 2월 18일
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

답변 (1개)

Image Analyst
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);

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by