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