From: Anna Lappala on
Hello,

I have a problem associated with the size of my matrix, which needs to be in 3D for 12000 given coordinates.. when i try to run my code, I get an error saying "Maximum variable size allowed by the program is exceeded." What can I do?

Thank you!

A
From: Walter Roberson on
Anna Lappala wrote:

> I have a problem associated with the size of my matrix, which needs to
> be in 3D for 12000 given coordinates.. when i try to run my code, I get
> an error saying "Maximum variable size allowed by the program is
> exceeded." What can I do?

You can use float (single precision) instead of double precision: that will
halve the amount of storage needed; whether it will have a meaningful affect
on your outputs depends what you are doing.

Possibly, depending exactly what you are doing, you could use int8 or uint8 or
int16 or uint16 and save even more storage.

Beyond that... install the 64 bit version and use that, if you have a 64 bit CPU.
From: Jan Simon on
Dear Anna!

> I have a problem associated with the size of my matrix, which needs to be in 3D for 12000 given coordinates.. when i try to run my code, I get an error saying "Maximum variable size allowed by the program is exceeded." What can I do?

Please post the size of the array exactly. A [12000 x 3] is a 3D array, or do you mean [12000 x 12000 x 12000] ?

Kind regards, Jan
From: John D'Errico on
"Anna Lappala" <s0793217(a)sms.ed.ac.uk> wrote in message <hms3ne$eq9$1(a)fred.mathworks.com>...
> Hello,
>
> I have a problem associated with the size of my matrix, which needs to be in 3D for 12000 given coordinates.. when i try to run my code, I get an error saying "Maximum variable size allowed by the program is exceeded." What can I do?
>

So all you need is roughly 14 terabytes of RAM?

Save up your pennies. Those multi-terabyte RAM chips
are not cheap.

What can you do? Design an algorithm to allow you
not to have to define that large of an array. Or choose
to work on smaller problems. Or find a job that pays
very well.

John
From: Walter Roberson on
Anna Lappala wrote:

> I have a problem associated with the size of my matrix, which needs to
> be in 3D for 12000 given coordinates.. when i try to run my code, I get
> an error saying "Maximum variable size allowed by the program is
> exceeded." What can I do?

I wonder if it would happen that a sparse matrix would be appropriate
for your situation?