Indexing matrix from array
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Inna Pelloso
am 25 Mär. 2022
Kommentiert: Inna Pelloso
am 25 Mär. 2022
Hi,
I have A = [1:3; 4:6; 7:9] and an index B = [1;0;1].
How can I extract from each column of A the values at are equal to 1 in B?
I want C = [1:3;7:9]. (I am trying to avoid having to use repmat for B)
Thank you!
IP
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
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!