Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

What is the maximum length of three dimensional matrix that I can save ?

Asked by Venkata Jayadeep Kodali on 25 Jun 2013

Hi I want to save a 8*16 matrix in a three dimensional matrix progressively. I want to allocate the maximum possible index for third dimension for quick execution. I know it depends on the system specifications and all. Please educate me in this topic .

If I dont pre allocate I get this message and I verified it also.

"Programs that change the size of a variable in this way can spend most of their run time in this inefficient activity. There is also significant overhead in shrinking an array on each iteration or in changing the size of a variable on each iteration. In such cases, MATLAB must reallocate and copy the contents repeatedly."

0 Comments

Venkata Jayadeep Kodali

Products

No products are associated with this question.

2 Answers

Answer by the cyclist on 25 Jun 2013

You can be "educated on this topic" if you read and understand this page: http://www.mathworks.com/help/matlab/matlab_prog/resolving-out-of-memory-errors.html.

However, just seeing how big an N you can make

x = rand(8,16,N)

will give you a useful upper limit.

0 Comments

the cyclist
Answer by Jan Simon on 26 Jun 2013

The 2nd output of http://www.mathworks.com/help/matlab/ref/computer.html defines the maximum number of elements in an array. But usuaully the limit is much lower due to the available free memory.

0 Comments

Jan Simon

Contact us