MATLAB: How to delete the last n elements of an array

reduce array

Hi, I am trying to delete the bottom n rows of an N X 2 array. I don't know how to do it. Would you please help?
For example, suppose that I have the matrix M=[3 6 3 7 9 11 5 34; 1 4 6 8 98 3 4 45]. I would like to delete the, say,the bottom 2 rows to get the new M=[3 6 3 7 9 11; 1 4 6 8 98 3]
How can I do this?
Please help.
Thank you.

Best Answer

It is simple
M = M(1:end-2,:)