Azzera filtri
Azzera filtri

How to solve this simple index problem

1 visualizzazione (ultimi 30 giorni)
Rita
Rita il 30 Ago 2015
Commentato: Rita il 30 Ago 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

Risposta accettata

Walter Roberson
Walter Roberson il 30 Ago 2015
idx = isnan(b);
c = a(idx);
D = [a(~idx), b(~idx)];

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by