Effacer les filtres
Effacer les filtres

How to deal with this

2 vues (au cours des 30 derniers jours)
dav
dav le 13 Mar 2013
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
  1 commentaire
Walter Roberson
Walter Roberson le 13 Mar 2013
You are not generating code. Please read the guide to tags and retag this question. http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags

Connectez-vous pour commenter.

Réponse acceptée

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

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by