array exceeds maximum array size preference

Hi everyone,
I am trying to run a "for loop" which increase the size of a matrix each iteration.
During one of my iteration i got this error- "Error using zeros
Requested 61263x61263 (28.0GB) array exceeds maximum array size preference. Creation of arrays greater than this limit
may take a long time and cause MATLAB to become unresponsive."
In matlab prefences --> workspace I have already defined the "array size limit" to 100% and it still does not help.
Is there any solution for this prolem besides bigger memory size?

댓글 수: 5

Yes, use smaller array sizes. Do you actually want such enourmous arrays? Or did you multiply a row and a column vector?
a=1:10;
b=a.';
size(a.*b)
ans = 1×2
10 10
Ron Bartov
Ron Bartov 2021년 11월 19일
Make the matrix bigger is not really the purpose. I currently study the course of “Transmission Lines” and I need to define a conductor profile as a matrix. Since the conductor shape is continuous I need to divide the length and width of the conductor by small “delta” value for getting it as an array of points matrix). Each dot is an electric potential. In our exercise we have vector that each of its entries is another delta value and we need to build the conductor with all of this value (every time with one value) and see the differences. Some of the deltas are good but for very small delta’s values the number of points are very large and there I get the error. Hope my explanation is clear.
Rik
Rik 2021년 11월 19일
You can't view 360 million points at once, so you could consider cutting up your task in smaller parts that actually fit in memory and return results that you can interpret. This is not enough detail for me to see how you might be able to avoid a loop.
Ron Bartov
Ron Bartov 2021년 11월 20일
I will try it. Thank you!
DGM
DGM 2021년 11월 21일
You may also find that a lot of these sorts of field calculations problems in T&D coursework exhibit symmetry that you can exploit to simplify the problem.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2021년 11월 19일

댓글:

DGM
2021년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by