How to deal with this

1 次查看(过去 30 天)
dav
dav 2013-3-13
Hi,
I have a large matrix that is generated in a simulation.
I have noticed that some of the columns are NAN (entire column).
Is there a way to
1) get the number of columns with NAN
2) delete the columns with NAN values
Thanks

采纳的回答

Walter Roberson
Walter Roberson 2013-3-13
find( any(isnan(YourMatrix)) )
and
YourMatrix(:, any(isnan(YourMatrix))) = [];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Function Definition 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by