Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
how to do average of nine variables over 00 and 12 GMT observations?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
% Load the grouping data
lat = ncread(ncfile,'latitude');
lon = ncread(ncfile,'longitude');
expver = ncread(ncfile,'expver');
time = ncread(ncfile,'time');
time = datetime(double(time)*60*60,'ConvertFrom','epochtime','Epoch','1900-01-01');
% convert grouping data to 4x4x2x6963 arrays
[Lon,Lat,Expver,Time] = ndgrid(lon,lat,expver,time);
dataTbl = timetable(Time,Lon,Lat,Expver,d2m,t2m,e,pev,ssr,ssrd,tp,vpd,rh)
% Calculate the mean over latitude x longitude x time
data = groupsummary(dataTbl,["Time","Time"],["hourofday","day"],"mean",4:12)
This code computes mean values of nine variables over lat x lon but not over the time (00 GMT and 12 GMT).
It writes 3482 rows of nine varaibles with 00 GMT and followed by 3481 rows of nine variables for 12 GMT.
I want to calculate the mean of nine variables from 00 and 12 GMT also. Therefore, the output data will
have the dimensions of (3481,9) in place of (6963,9). I request you to kindly suggest me how to do it in
above mentioned matlab code. I would appreciate your kind help.
Sanchit Singh
0 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!