Reputation: 11
I am trying to reach and store 4 rows from a square matrix. Can you please help me? I have square matrix with size 10 x 10
and I am looking for rows number 2, 5, 6 and 9 to store them in one matrix.
Upvotes: 1
Views: 84
Reputation: 522732
You can select the submatrix you want using this code:
B = A([2 5 6 9], :)
The :
subscript will select all columns, which I am assuming is what you want.
Upvotes: 3