How to select rows from an array?
155 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have matrix of A
. I need to select the 2nd, 4th and 6th row. How can I write that in MATLAB code?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1154178/image.png)
0 Kommentare
Antworten (3)
Torsten
am 12 Okt. 2022
B = [A(2,:);A(4,:);A(6,:)]
or if you want the rows one by one:
A2 = A(2,:);
A4 = A(4,:);
A6 = A(6,:);
0 Kommentare
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!