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
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!