Add two rows in a matrix with new datas
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Frederike Petersen
il 6 Ott 2021
Commentato: Frederike Petersen
il 6 Ott 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 Commenti
Risposta accettata
Chetan Bhavsar
il 6 Ott 2021
Modificato: Chetan Bhavsar
il 6 Ott 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,:)];
Più risposte (1)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!