필터 지우기
필터 지우기

Determine when the graph becomes flat

조회 수: 19 (최근 30일)
LB
LB 2016년 10월 5일
댓글: LB 2016년 10월 6일
Hi! I have a set of x and y-data which I have plotted in a diagram. I want to find a way to plot a horizontal line in my diagram when my graph (y-values) becomes flat for increasing x, i.e. when y(n+1)-y(n) is less than some number.
Is there a way I can do that using a loop or something? I appreciate all your help :)

답변 (1개)

Jan
Jan 2016년 10월 5일
lastSteepIndex = find(diff(y) >= limit, 1, 'last')
Now you have the index of the last element with non-flat data.
  댓글 수: 1
LB
LB 2016년 10월 6일
Thank you, this was very useful!

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by