From: Patrick on 9 May 2010 22:30 "Steven Lord" <slord(a)mathworks.com> wrote in message <hs7o41$rpf$1(a)fred.mathworks.com>... > > "Patrick " <gallagjo(a)interchange.ubc.ca> wrote in message > news:hs7kdj$2j3$1(a)fred.mathworks.com... > > Tombo H <tombo.hayworth(a)gmail.com> wrote in message > > <69e88147-ce61-4284-acac-48465a9012fd(a)k19g2000yqm.googlegroups.com>... > >> Didn't this work: > >> > >> averageMatrix = (1/31) * > >> (Dec01+Dec02+Dec03+Dec04+Dec05+Dec06+Dec07+Dec08+Dec09+Dec10+Dec11+Dec12+Dec13+Dec14+Dec15+Dec16+Dec17+Dec18+Dec19+Dec20+Dec21+Dec22+Dec23+Dec24+Dec25+Dec26+Dec27+Dec28+Dec29+Dec30+Dec31); > >> > >> where each Decnn is a 13x9 double matrix? > > > > Yes, although the command string could get quite long (I actually want to > > average more than a month's worth of days), this appears to be a simple > > solution that works. Thanks for the quick response. > > In that case, don't create variables like that. Instead, since they're all > the same size, store them as "pages" of a 3D array. > > dataForDecember = zeros(13, 9, 31) > > Then use MEAN specifying the dimension over which you want to take the mean. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > OK, thanks. I haven't used 3D arrays much, but it seems clear now that that's the way to go and all I need to do is figure out the most efficient way to load the array with the data as I download it. Cheers, Patrick
First
|
Prev
|
Pages: 1 2 Prev: Get keypress without locking/last key pressed? Next: MATLAB closes automatically |