Obtain SUM for a 3D matrix

60 vues (au cours des 30 derniers jours)
Damith
Damith le 14 Juil 2015
Commenté : Matt J le 14 Nov 2021
Hi,
I have a precip matrix 360 x 280 x 365 and I want to obtain the sum for all the values in (:,:,365). For example,
output = sum(precip(360x280x1)+precip(360x280x2)+precip(360x280x3)..+precip(360x280x365)
So, the output matrix should be, output = 360 x 280. Can anyone suggest me a methos in MATLAB?
Thanks in advance.

Réponse acceptée

Matt J
Matt J le 14 Juil 2015
Modifié(e) : Matt J le 14 Juil 2015
output = sum(precip,3);
  3 commentaires
hussain Palagiri
hussain Palagiri le 14 Nov 2021
How to get sum for only 90 pages out of 365 pages?
Matt J
Matt J le 14 Nov 2021
output = sum(precip(:,:,1:90),3);

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by