MATLAB: Splitting a matrix into 2 sub matrices based on row number

splitting matrix

I have a 10×22 matrix, which I need to split into one 6×22 and one 4×22.
I want rows 1, 4, 7, 8, 9, 10 from the 10×22 matrix to become the 6×22 matrix, and the remaining rows to become the 4×22 matrix.
How can I do that?
Thanks!

Best Answer

y=M([1 4 7 8 9 10],:);
z=M([2 3 5 6],:);