0

I have a matrix say (+) order, I want to extract first order matrix, like say

`A matrix,

I want to extract first

required

Sardar Usama
  • 19,536
  • 9
  • 36
  • 58
Marso
  • 131
  • 4
  • 1
    You may need to read something about [indexing](https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html) – rahnema1 Jun 21 '17 at 13:05

1 Answers1

2

As suggested by rahnema1, you can use Matrix Indexing in matlab as follows:

partA = A(1:p, :)

or for your specific example:

partA = A(1:3, :)

Explanation

  • 1:p: selects all rows between 1 and p.
  • : selects all columns.

Further reading

As this seems a basic question to me, it may be useful to have a look at the Getting Started tutorial.

m7913d
  • 10,244
  • 7
  • 28
  • 56