Effacer les filtres
Effacer les filtres

Getting rid of NaN from 1 by n matrix

1 vue (au cours des 30 derniers jours)
Nathaniel
Nathaniel le 8 Juin 2012
The matrix looks like this
[1,2,3,4,5,6,7,NaN,NaN......NaN]
The NaN are at the end of the matrix.
How do I get rid of those and turn this matrix into [1,2,3,4,5,6,7]?

Réponse acceptée

Ryan
Ryan le 8 Juin 2012
A =[1,NaN,2,3,NaN,4,5,NaN,6,7,NaN,NaN];
A(isnan(A)) = [];
  1 commentaire
Nathaniel
Nathaniel le 8 Juin 2012
thank you!!

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by