From: Thomas Britton on
Dear All,

I'm running into serious memory problems with Matlab 2010a and large arrays. I have 32bit WinXP and have tweaked all the memory options as much as I can. My data sets are quite big and thus I'm running into memory problems still.

In particular I have an 4d double array which I'd like to have as (230,130,33,120) elements. I would like to work out an efficient way of splitting the array up/dealing with it that maintains both the first and second dimensions (as they are in effect 'images' of the data structure).

Unfortunately the program I am writing may change the '33' size dimension and I'd like to treat that more efficiently than I am now. Splitting the array into (230,130,5,120) blocks seems to make it manageable, as I can then perform subsequent operations but it requires me to explicitly call the array name and is both inelegant and prone to me making an indexing typo.

Are there any suggestions on how to deal with this sort of problem?

Thanks,
Ben
From: Rune Allnor on
On 29 apr, 13:30, "Thomas Britton"
<benjamin.brit...(a)materials.ox.ac.remove.uk> wrote:

> Are there any suggestions on how to deal with this sort of problem?

Use some other programming language than matlab, that allows
you to use a data structure that is suited to your problem.

Rune
From: Thomas Britton on
Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <1aeac9c9-9d8b-45cd-aac9-c1d888b52148(a)y36g2000yqm.googlegroups.com>...
> On 29 apr, 13:30, "Thomas Britton"
> <benjamin.brit...(a)materials.ox.ac.remove.uk> wrote:
>
> > Are there any suggestions on how to deal with this sort of problem?
>
> Use some other programming language than matlab, that allows
> you to use a data structure that is suited to your problem.
>
> Rune

Unfortunatly, given the amount of time it would take to translate my program and implement a lot of linear programming solutions implemented in matlab this is infeasible.

Are there any solutions that more efficiently use the matlab memory or variable naming conventions?
From: Bruno Luong on
"Thomas Britton" <benjamin.britton(a)materials.ox.ac.remove.uk> wrote in message <hrbqkh$g5q$1(a)fred.mathworks.com>...
> Dear All,
>
> I'm running into serious memory problems with Matlab 2010a and large arrays. I have 32bit WinXP and have tweaked all the memory options as much as I can. My data sets are quite big and thus I'm running into memory problems still.
>
> In particular I have an 4d double array which I'd like to have as (230,130,33,120) elements. I would like to work out an efficient way of splitting the array up/dealing with it that maintains both the first and second dimensions (as they are in effect 'images' of the data structure).

You might keep 3 dimensions together in 3D-arrays, and split the dimension (e.g. the third) in *cell* array.

For example instead of the array

M = rand(230,130,33,120);

Use rather

M = cell(1,33);
for k=1:33
M{k} = rand(230,130,120);
end

The difference is the first need a big contiguous block, whereas splitting in cell will require a chunk of smaller blocks.

Bruno
From: Sean on
"Thomas Britton" <benjamin.britton(a)materials.ox.ac.remove.uk> wrote in message <hrbqkh$g5q$1(a)fred.mathworks.com>...
> Dear All,
>
> I'm running into serious memory problems with Matlab 2010a and large arrays. I have 32bit WinXP and have tweaked all the memory options as much as I can. My data sets are quite big and thus I'm running into memory problems still.
>
> In particular I have an 4d double array which I'd like to have as (230,130,33,120) elements. I would like to work out an efficient way of splitting the array up/dealing with it that maintains both the first and second dimensions (as they are in effect 'images' of the data structure).
>
> Unfortunately the program I am writing may change the '33' size dimension and I'd like to treat that more efficiently than I am now. Splitting the array into (230,130,5,120) blocks seems to make it manageable, as I can then perform subsequent operations but it requires me to explicitly call the array name and is both inelegant and prone to me making an indexing typo.
>
> Are there any suggestions on how to deal with this sort of problem?
>
> Thanks,
> Ben

How much information would you lose by conversion to single?