Azzera filtri
Azzera filtri

How to trim down data?

1 visualizzazione (ultimi 30 giorni)
AbelM Kusemererwa
AbelM Kusemererwa il 24 Lug 2015
Risposto: Star Strider il 24 Lug 2015
a=[1;2;3;44;15;6;7;82;9] , b=[1;2;3;3;3;3;1;3;3] and c=[14;28;36;44;5;6;12;21;19]. I would want use this selection criteria; select only the elements of b which are =3 and their corresponding values in a and c.
How can I trim this data down to a=[3;44;15;6;82;9], b=[3;3;3;3;3;3] and c=[36;44;5;6;21;19]?

Risposta accettata

Star Strider
Star Strider il 24 Lug 2015
This works:
a=[1;2;3;44;15;6;7;82;9];
b=[1;2;3;3;3;3;1;3;3];
c=[14;28;36;44;5;6;12;21;19];
a3 = a(b == 3)
c3 = c(b == 3)

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by