How to find the starting position of the array from where its value is strictly increasing?

조회 수: 2 (최근 30일)
I have a huge temperature data with 2000 values.
It takes a couple of minutes for thermocouple to stabilize and then it increases steadily. I want to find out the position from which it is strictly increasing.
Thanks

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 7월 16일
편집: Azzi Abdelmalek 2012년 7월 16일
y=[1 2 5 0 4 2 7 8 9]
%one line command
max([1 max((find(diff(y)<=0))+1)])
  댓글 수: 4
Azzi Abdelmalek
Azzi Abdelmalek 2012년 7월 17일
편집: Azzi Abdelmalek 2012년 7월 17일
Walter, it's never empty, it's a concatenation [1 v], if v is empty, the result is not, max([1 v]) will be 1

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

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 7월 16일
pos = find( diff(YourData) <= 0, 1, 'last' ) + 1;
if isempty(pos); pos = 1; end

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by