how to display all non NaN values in a matrix

342 vues (au cours des 30 derniers jours)
Nancy
Nancy le 15 Fév 2012
Hi,
I have an array that looks like
A= [NaN 1 3 NaN NaN 5 NaN NaN 6];
what function should I run to make it look like this
A=[1 3 5 6];
Thanks Nancy

Réponses (1)

G A
G A le 15 Fév 2012
A=(A(~isnan(A)));

Catégories

En savoir plus sur Logical 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