MATLAB: How to get the mean of the last 50 values of a column which actually has 200 values in it

MATLAB

when I want to have the mean value of my column 3, I can use M= mean( matrixname(:,3)). But this time I only want to get the mean value of the last 50 values of the same column, not the whole column.-the whole column has 200 values.- What should I write for this?

Best Answer

I would calculate it as:
M_Last_50 = mean( matrixname(end-49:end,3));