How do I take the average of every 50th term in a 2500x1 vector?
2 次查看(过去 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
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!