MATLAB Answers

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

조회 수: 1(최근 30일)
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

댓글을 달려면 로그인하십시오.

채택된 답변

Stalin Samuel
Stalin Samuel 15 Sep 2017
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

댓글을 달려면 로그인하십시오.

추가 답변(0개)


Translated by