I want to obtain value and index of first non-NaN element from each column of a matrix in the matlab.
In a separate problem--- There are few columns that does not have NaN. So in that case-- I would like to extract value and index of first non-NaN element from each column and otherwise first element of each column if column does not contain NaN.
Can anybody help regarding these two problems?