How do I find the average of all rows across a series of columns?
2 ビュー (過去 30 日間)
古いコメントを表示
Carlie Jones-Hershinow
2018 年 4 月 25 日
コメント済み: Carlie Jones-Hershinow
2018 年 4 月 25 日
I am fairly new to Matlab so I'm sorry if this seems super obvious...
Have a matrix of 1000 rows, and 10 columns. How do I find the average across all the rows, and then save that column of averages into a new matrix? (this is in a loop)
EMGmatrix(:,j-1) = EMG_new; Average = mean(EMGmatrix(:,:);
Thanks!
0 件のコメント
採用された回答
Birdman
2018 年 4 月 25 日
You do not need a loop for this. Consider the following case:
A=randi([1 4],1000,10);%demo data
res=mean(A,2);
res variable contains the average of each row, which is 1000x1.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!