Effacer les filtres
Effacer les filtres

Averaging 3D matrix value and reshape

1 vue (au cours des 30 derniers jours)
Arup Bhattacharya
Arup Bhattacharya le 17 Oct 2019
I have a Matrix named June21_Once_StillMat - the size of which is 15 x 41 x 40. I am trying to get the data from the colums 2 to 8 of the matrix une21_Once_StillMat to a new matrix A of size 15 x 8 x 40.
for j=1:15;
for k=1:8;
for i=1:40;
A(j,k,i)=June21_Once_StillMat(j,k+1,i);
end
end
end
I need to average the values of each row over i (40) from matrix A and populate that data to a new 3D matrix B of size 8 x 8 x 15. The third column of matrix B, B(k,3,j) will have the value obtained from the averaged value and the 4th column of matrix B, B(k,4,j) will be the standard error. I am not being able to figure this out.

Réponses (1)

Yuan Li
Yuan Li le 17 Oct 2019
A = zeros(15,8,40);
A = June21_Once_StillMat(1:end,2:9,1:end);
A1 = mean(A,3);
then you will get a 15by8 matrix(mabe you need to rshape it), and the standard error comes from where?

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by