Add two rows in a matrix with new datas
1 回表示 (過去 30 日間)
古いコメントを表示
Frederike Petersen
2021 年 10 月 6 日
コメント済み: Frederike Petersen
2021 年 10 月 6 日
I have a pascal triangle matrix pascal(10) = E. Now I have to calculate the mean and the standard deviation of each column of E. The results have to insert as row 6&7 in Matrix E. (At the end the matrix should have [12 10]).
Thanks for your advices!
0 件のコメント
採用された回答
Chetan Bhavsar
2021 年 10 月 6 日
編集済み: Chetan Bhavsar
2021 年 10 月 6 日
you can do this in below way
E = pascal(10);
k = 5;
E = [E(1:k,:); std(E); E(k+1:end,:)];
k = 6;
E = [E(1:k,:); mean(E); E(k+1:end,:)];
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!