Add two rows in a matrix with new datas
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Frederike Petersen
el 6 de Oct. de 2021
Comentada: Frederike Petersen
el 6 de Oct. de 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 comentarios
Respuesta aceptada
Chetan Bhavsar
el 6 de Oct. de 2021
Editada: Chetan Bhavsar
el 6 de Oct. de 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,:)];
Más respuestas (1)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!