Detect NaN from table
显示 更早的评论
Hello! I would like your help on my issue.
I have an excel file (see attached) that contains daily pollution data from 2006-2016. For the columns B to H I would like to find NaN values for each column, sum them, and in the end, store all these in a new table.
So far I have done this for column B:
[ii jj] = find(isnan(MoT20062016S1.SO2gm3));
outij = sortrows([ii jj]);
length(outij)
How can I expand outij to include columns C to H?
Thanks in advance!
PS. I'm on R2019a
回答(1 个)
KSSV
2021-5-24
A = [1 2 NaN 5 NaN] ;
idx = isnan(A) ;
A(idx)
5 个评论
Daphne PARLIARI
2021-5-24
KSSV
2021-5-24
Run a loop for each column.
for i = 2:7
t = T.(i)
end
Daphne PARLIARI
2021-5-24
KSSV
2021-5-24
It is a loop, which picks each column of table depedning on the loop index.
Are you looking for nansum? Read about it.
Daphne PARLIARI
2021-5-24
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!