MATLAB: How can ı calculate the mean of an interval

mean of a specified interval

There are 300 elements in my vector (vector A). I want to calculate the mean of all the elements from 200th to 300th element. How do I do that?

Best Answer

A = rand(300,1) ;
iwant = mean(A(200:300)) ;