Remove rows with NaN from a table
显示 更早的评论
I have a table T. T has some rows with NaN. I would like to remove any rows with NaN in any entry. Please advise.
采纳的回答
更多回答(1 个)
Walter Roberson
2018-6-13
T( any(ismissing(T),2), :) = [];
4 个评论
alpedhuez
2018-6-13
Paolo
2018-6-13
What does your comment mean? Both solutions work fine and solved your problem. Please mark any answer as accepted.
Walter Roberson
2018-6-13
rmmissing is good, and I did not know about it. I voted for Paolo's answer, but I left mine as an alternative solution.
Blake
2019-9-19
Walter thanks:
For some reason, Pablo's answer didn't work on my data which had mixed data types, but yours did.
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Identification 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!