MATLAB: How to call multiple rows of an existing matrix

MATLABmatrixmultiple rowsrowsrows of matrix

I want to know how to call multiple rows of an existing Matrix so I can make a new matrix that consists of the first 3 rows of my existing matrix.
MatrixA = [ a b c d ; e f g h ; i j k l ; m n o p ]
I want MatrixB = [ a b c d ; e f g h ; i j k l ]
All can figure out is how to call only the first row by using the following code: MatrixB = MatrixA(1,:) which outputs MatrixB = [ a b c d ]
Similary, I would also like to make another matrix that consist of the first 3 elements in the first 3 rows. i.e. MatrixC = [ a b c ; e f g ; i j k ]

Best Answer

Try this
MatrixB = MatrixA(1:3, :);