I have an array of 1000 elements I need to do average of 100 elements so that my new array is of 10 elements...
    5 ビュー (過去 30 日間)
  
       古いコメントを表示
    
I have an array of 1000 elements I need to do average of 100 elements so that my new array is of 10 elements...
0 件のコメント
回答 (1 件)
  Guillaume
      
      
 2017 年 3 月 21 日
        reshape your array into 100 rows, take the mean across these 100 rows:
assert(mod(numel(yourarray), 100) == 0, 'number of elements is not a multiple of 100')
mean(reshape(yourarray, 100, []))
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Matrices and Arrays についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
