Effacer les filtres
Effacer les filtres

How to solve this simple index problem

1 vue (au cours des 30 derniers jours)
Rita
Rita le 30 Août 2015
Commenté : Rita le 30 Août 2015
Hi, I have
a=[1;2;3]and b=[23;nan;4]
how I can get these
c=[2] and also D=[1,23;3,4]
Thanks a lot

Réponse acceptée

Walter Roberson
Walter Roberson le 30 Août 2015
idx = isnan(b);
c = a(idx);
D = [a(~idx), b(~idx)];
  1 commentaire
Rita
Rita le 30 Août 2015
Thanks a lot Walter

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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