Filter löschen
Filter löschen

How to solve this simple index problem

1 Ansicht (letzte 30 Tage)
Rita
Rita am 30 Aug. 2015
Kommentiert: Rita am 30 Aug. 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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 30 Aug. 2015
idx = isnan(b);
c = a(idx);
D = [a(~idx), b(~idx)];

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by