Good evening,
I have a column vector such that
vec = [1 ; 2 ; 3 ; 4 ; Nan ; 5 ; 6 ; 7 ; 8 ; Nan ; 9 ; 10 ; 11 ; 12 ; Nan];
I would like to find extract the elements of the vector ''vec'' that are located right after the NaN, such that I would get a new vector:
new_vec=[5;9]
It is very easy to find the indices of all the NaN elements, however I don't know how to 'shift' those indices a place further to locate the values right after the NaN.
Thanks for your help in advance,
KMT
Best Answer