I have this code which converts the output of a process i'm running into a table, then to an array, and then finds the first instance that a number crosses a threshold:
T = table(Spots); %convert output of Ornstein-Uhlenbeck process to table
A = table2array(T); %convert table to array
>> [I,J] = find(A<-400); %find first instance of -400 in each column, and report the row position
>> [~,m] = unique(J, 'first');>> I(m);
The array is 300×4 double and I and J are both 797×1 double.
I am trying to change this to find the first instance of two consecutive numbers below the threshold (-400) and have that reported to me. What would be the best way to go about this?
Thanks,
Mike
Best Answer