Turning a time-based X-axis into equal percentages

조회 수: 1 (최근 30일)
Michael
Michael 2015년 2월 17일
답변: Michael 2015년 2월 18일
Much of the data I work with are forces over time. Unfortunately, time is never the same between two trials (see attached photos). I would like to take this time data and divide it into 10 equal blocks from start to finish (i.e., 0-10%, 10-20%, 20-30%,.......90-100%). This way I can compare what happens between trials. Any suggestions?
As a secondary question, I am interested in getting specific values out of these percentage blocks (i.e., max between 20-30%). Thoughts?
Thank you for all of your help.
  댓글 수: 2
Sara
Sara 2015년 2월 17일
If t is time, I assume now you're doing something like plot(t,x). You could replace that with plot(t/t(end)*100,x). Now the x-axis is in % of total time. To have bins (i.e., one value representative of an interval), you could average all the data in the specific interval. Is that what you want?
Michael
Michael 2015년 2월 18일
Thank you Sara. I was able to get my x-axis scaled from 0-100%, but I am having trouble putting these in sub-bins. I am trying to find a value (let's say mean) on another line between percentage bins (see picture).
Thank you so much

댓글을 달려면 로그인하십시오.

채택된 답변

Michael
Michael 2015년 2월 18일
This was the code I was able to use to get the x-axis into a percentage. I had to do other filtering things first, because of the nature of my data.
Thanks Sara
zmax = max(Fzfilt); start=zmax/10; ind1 = find(Fzfilt >= start, 1, 'first'); ind2 = find(Fzfilt >= start, 1, 'last');
t1 = t(ind1); t2 = t(ind2);
tscale = (((t(ind1:ind2)-t1)/(t2-t1))*100)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by