Effacer les filtres
Effacer les filtres

How to take an average of three dimensional data?

16 vues (au cours des 30 derniers jours)
SONI SONI
SONI SONI le 14 Mar 2018
Commenté : Walter Roberson le 16 Août 2021
Hi,
I have a three-dimensional matrix (360 x 720 x 60), in this matrix 60 represents monthly data of 5yeras (for example monthly temperature). I want to take the annual average of these monthly values so that the final matrix will be 360 x 720 x 5.

Réponse acceptée

James Tursa
James Tursa le 14 Mar 2018
x = your 3D matrix
result = mean(reshape(x,360,720,12,5),3);
  7 commentaires
elliot brooksbank
elliot brooksbank le 16 Août 2021
Hi james
i have a similiar dataset but the matrix is (30x17x456) the 456 represents months i need the monthly average temperature for each month
Walter Roberson
Walter Roberson le 16 Août 2021
mean(yourmatrix, [1 2])
%or
mean(reshape(yourmatrix, [], size(YourMatrix,3)))

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by