MATLAB Answers

HOw do i find indices of 'NAN' rows in excel raw file in matlab?

1 view (last 30 days)
sachin narain
sachin narain on 5 Jun 2018
Answered: KSSV on 6 Jun 2018
I have raw excel file imported in matlab.It is a 5x5 raw file.There are cells where there are 'NAN'in it .I have to find the indices of the 'NAN' rows in the raw file. Can anyone help me to solve this?
I have attached my raw file


Jan on 5 Jun 2018
What is a "raw excel file"? Where are these "NaN" 's displayed? Are they strings? Is this the array browser of Matlab?
sachin narain
sachin narain on 6 Jun 2018
YEs .This is a browser of matlab.NAN's are but empty spaces in excel.In matlab it shows as NAN.

Sign in to comment.

Answers (1)

KSSV on 6 Jun 2018
YOu can get the NaN's position using: isnan
Rea dabout isnan for logical indexing. Also have a look on find.
A = [1 2 NaN 4 NaN] ;
idx = isnan(A) %logical indexing
pos = find(idx) % indices


Sign in to comment.

Sign in to answer this question.