How to calculate the average value of selected row, column from a given matrix.
Mostrar comentarios más antiguos
I have a matrix A =[ 16 2 3 13 16 ; 5 11 10 8 8 ; 9 7 6 12 5; 4 14 15 1 3] . I want to calculate the avarage value for A(i.j) where i ranges from 1 to 3 and j from 0 to 2. Can You please help me with this?
Respuesta aceptada
Más respuestas (1)
A =[ 16 2 3 13 16 ; 5 11 10 8 8 ; 9 7 6 12 5; 4 14 15 1 3]
i=1:3;
j=1:2;
out_each_col=mean(A(i,j),1)
out_each_row=mean(A(i,j),2)
1 comentario
U B
el 14 de Feb. de 2023
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!