Mean and std across high dimensional 3d matrices

1 view (last 30 days)
Hi everyone!
I'm working with high dimension 3d matrices (182x218x182). I have 10 of them and i need to create the mean-matrix and the std matrix (across all of them). I've already tried to convert/reshape the into arrays (very long) and then work on them but I had memory problems..
Does anyone of you know some tool7trick that allow you to work with big 3 d matrices?
Thanks in advance!
  1 Comment
Oleg Komarov
Oleg Komarov on 14 Apr 2011
It's not about tool/tricks, it'a about how you implement it. So, post the code and be more specific about what you're trying to accomplish.
What's a mean/std matrix across all of them?

Sign in to comment.

Answers (1)

Jan
Jan on 14 Apr 2011
EDITED: Just typos.
Your "big" [182x218x182] array uses only 57.8 MB of memory. Therefore I would not call it big. And if you install >= 1GB RAM working with such arrays should be done very efficiently in Matlab.
You could use SINGLE or an integer type to save memory, but this does not work, if you need double precision data.
Clearing variables which are not needed anymore is helpful also. But most of all a strict pre-allocation of all arrays is important, because it reduces the fragmentation of the avaliable memory.
But of course installing more RAM and using a 64-Bit system would be the most efficient solution, because this handles the physical source of the memory problem...

Community Treasure Hunt

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

Start Hunting!