how can find a point from an array where the points it follows start to decrease
이전 댓글 표시
i have array contains points, somehow it exist a part of this array where are decreasing ,how can i find this part, i really need a help
채택된 답변
추가 답변 (2개)
Azzi Abdelmalek
2016년 2월 17일
%Example
t=0:0.1:20
y=sin(t)
plot(t,y)
%---------------------
ii=diff(y)>0
jj=strfind(ii,[1 0])
tout=t(jj)
yout=y(jj)
Jos (10584)
2016년 2월 17일
A decrease is where an element is smaller than the element before it.
A = [1 2 3 4 3 2 1]
changeInA = diff(A)
isDecreasing = changeInA < 0
whereDecreasing = find(isDecreasing) % perhaps add 1 to this
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!