Add two rows in a matrix with new datas
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Frederike Petersen
le 6 Oct 2021
Commenté : Frederike Petersen
le 6 Oct 2021
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 commentaires
Réponse acceptée
Chetan Bhavsar
le 6 Oct 2021
Modifié(e) : Chetan Bhavsar
le 6 Oct 2021
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,:)];
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!