Borrar filtros
Borrar filtros

How to take an average of three dimensional data?

16 visualizaciones (últimos 30 días)
SONI SONI
SONI SONI el 14 de Mzo. de 2018
Comentada: Walter Roberson el 16 de Ag. de 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.

Respuesta aceptada

James Tursa
James Tursa el 14 de Mzo. de 2018
x = your 3D matrix
result = mean(reshape(x,360,720,12,5),3);
  7 comentarios
elliot brooksbank
elliot brooksbank el 16 de Ag. de 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 el 16 de Ag. de 2021
mean(yourmatrix, [1 2])
%or
mean(reshape(yourmatrix, [], size(YourMatrix,3)))

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by