MATLAB Answers

How do I take the average of every 50th term in a 2500x1 vector?

I have a 2500x1 vector and I'm trying to find if the average of the average of every 50th term equals the average of all 2500 variables.

  댓글 수: 0

로그인 to comment.

답변 수: 1

回答者: Stalin Samuel 2017 年 9 月 15 日
 採用された回答

s=rand(2500,1); %2500x1 vector
Out1=mean(reshape(s,[50 50])); %mean of every 50 values
out2=mean(s(50:50:2500)) % mean of every 50th value

  댓글 수: 0

로그인 to comment.



Translated by