Effacer les filtres
Effacer les filtres

Remove NaN and create one column

2 vues (au cours des 30 derniers jours)
Damith
Damith le 3 Juil 2014
Commenté : Damith le 4 Juil 2014
Hi,
I have a matrix A (31 x 12) which has NaN values and need to remove all NaN values and make it a one column (:). How can I do it MATLAB?
  1 commentaire
per isakson
per isakson le 4 Juil 2014
Modifié(e) : per isakson le 4 Juil 2014
Delete one of your two nearly identical questions!

Connectez-vous pour commenter.

Réponse acceptée

per isakson
per isakson le 4 Juil 2014
"I have this matrix A and has NaN values. I need
  1. to remove NaN values from all the columns and
  2. write the values into one column (:)."
Step one is not possible because it would result in columns with different length.
Switching the order of the steps will return a result
A = A(:);
A( isnan( A ) ) = [];
  1 commentaire
Damith
Damith le 4 Juil 2014
Thanks a lot. It worked. This is the result I wanted.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by