I wish to calculate the mean values of temperature over the latxlon grid and only for 12GMT for all the 65 months using matlab code.
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a data with dimension (lat,lon,time,months) as (5,5,2,65)
number of latitude =5
number of longitude =5
time = 1 for 00 GMT and 2 for 12 GMT
number of months 65
I wish to calculate the mean values of temperature over the latxlon grid and only for 12GMT for all the 65 months using matlab code.
Any suggestions would be highly appreciated.
regards,
Devendra
0 commentaires
Réponses (2)
Sathvik
le 29 Juin 2023
Hi
You can take the mean of the data as such
latxlon = randi([20 40],5,5,2,65);
meanTemp = mean(latxlon(:,:,2,:));
If you want to take the mean over all 65 months, you can take the mean along the 4th dimension.
meanTemp = mean(latxlon(:,:,2,:),4)
Here is a link to the documentation
Hope this helps!
4 commentaires
Sanchit
le 18 Juil 2023
I have attached the netcdf matlab code to read the data and netcdf input file. I want to calculate the mean values of nine varaibles over lat x lon x time x 6961 (4,4,2,6961) for each variable. I request you to kindly modify the code to get the required data. Thanks a lot for your help.
Sanchit
Voir également
Catégories
En savoir plus sur Data Import and Analysis 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!