Mean of some element in Array

1 回表示 (過去 30 日間)
Rica
Rica 2012 年 11 月 2 日
Hi! I have a array of size 8501*1. iwa nt to have the mean value of each 10 element. Afte each 10 elebent make a mean value. How to do this in matlab withot for-loop
Thanks

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 11 月 2 日
編集済み: Azzi Abdelmalek 2012 年 11 月 2 日
A=rand(8501,1); %your data
B=mean(reshape(A(1:8500),10,[]))
with the for loop
ii=1;
A=rand(8501,1)
for k=1:10:8501-10
out(ii)=mean(A(k:k+9));
ii=ii+1
end
  1 件のコメント
Rica
Rica 2012 年 11 月 2 日
Merci

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by