Grid data into monthly average?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hydro
am 10 Dez. 2014
Kommentiert: Hydro
am 10 Dez. 2014
Hello All,
I have a grid data set for 32 years (384 months) in the form A=(180*360*384), I want to find monthly average for the January. that means average for 32 years for January. I tried to reshape the data however, its not working, can somebody help me out here please?
I am trying with this
R=reshape (A,12,32)
However, i am getting error.
Thanks
2 Kommentare
dpb
am 10 Dez. 2014
What, precisely, is the storage arrangement again? Is it 3D of A(180,364,384) or is it simply a vector of length(180*364*384)? What do the 180 and 364 refer to; 364 seems peculiar if is days instead of 365 or is that a typo?
The key here is where are the values for Jan 1 for year one and subsequent years -- not exactly sure.
Akzeptierte Antwort
Mohammad Abouali
am 10 Dez. 2014
Bearbeitet: Mohammad Abouali
am 10 Dez. 2014
You are on right track:
Use this:
% Making some sample random data
A=rand(180,360,384);
% reshaping
Areshaped=reshape(A,180,360,12,32);
% Averaging along the 4th dimension (year)
Amean=mean(Areshaped,4);
size(Amean)
180 360 12
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Holidays / Seasons finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!