Check out the documentation page here: https://www.mathworks.com/help/matlab/math/array-indexing.html (Indexing with Logical Values is about halfway down)
There's also a nice article on indexing here: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html
What this boils down to is you can index by row/column numbers: M(3,:) M([1 3 5],:) or by logicals (M([true;false;true;false;true],:))
M=magic(5)
M(3,:)
M([1 3 5],:)
M([true;false;true;false;true],:)
Note that logical indexing is really really useful!
M(M(:,1)>10,:) % Rows of M where the first column is greater than 10
M(mod(M,2)==0)' % Even values in M
load sonnetsTable.mat
tbl.Word(tbl.Count>20)' % Words that occurred more than 20 times
load patients
% mean of smokers, non smokers, and smokers with weight above the median
[mean(Diastolic(Smoker)) mean(Diastolic(~Smoker)) mean(Diastolic(Smoker & Weight>median(Weight)))]