Find the column names and total number of columns having all the entries as NaNs

10 次查看(过去 30 天)
Hello All,
I have an excel sheet "abc.xls" which has n columns. I want to read the excel file and display the total number of columns having all the entries as NaNs and the names of the columns having NaN values. Below is the example excel file.
Thanks in Advance,
Sharan

回答(1 个)

Image Analyst
Image Analyst 2020-9-15
If abc is your matrix, try this
nanMap = isnan(abc(2:end, :)); % Ignore first row.
columns = find(all(nanMap, 1));
Not sure what you mean by the names of the columns but if you have the column numbers, you can use the attached utility to turn a column number into an Excel letter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by