Find time of slope change

조회 수: 5 (최근 30일)
Sarah Levovitz
Sarah Levovitz 2018년 7월 17일
댓글: Sarah Levovitz 2018년 7월 19일
I want to find the time where the slope of the graph starts to decrease. In this case, the graph is a measurement of the foot angle of someone walking. I would like to use MATLAB to detect when the person starts walking, which in this case seems to be at around 2 seconds. The problem is that there is a dip in the graph right at the beginning. Is there a way to detect an area of a graph with a slope close to 0, and then find where the first change that happens after that? I would like to also be able to use this code for other sets of data that do not look exactly the same.

채택된 답변

jonas
jonas 2018년 7월 17일
편집: Image Analyst 2018년 7월 17일
If you have the signal processing toolbox, you can try the function findchangepts. I believe the very similar ischange would be equally useful.
Here is an example. See attachment for results.
pts=findchangepts(y,'Statistic','linear','MinThreshold',20);
plot(x,y,'-b',...
x(pts),y(pts),'rx')
  댓글 수: 5
Sarah Levovitz
Sarah Levovitz 2018년 7월 19일
thank you very very much, this worked perfectly!
Sarah Levovitz
Sarah Levovitz 2018년 7월 19일
@Image Analyst, thank you for the comment, I will note this for future.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by