??? Error using ==> ones , Maximum variable size allowed by the program is exceeded

hi every one
MATLAB will make me crazy,,,,, when i try to make an array with (16777216) elements, i got this error,,,,,
r=ones(16777216);
??? Error using ==> ones , Maximum variable size allowed by the program is exceeded
but when i make an array with the same number of elements but in diffrent dimensions then no problem.
r=ones(4096,4096);
reshape(r,1,16777216)
when i reshape the array to (1,16777216), then also no problem.
any one know why this happened?? its the same size, right?
i'm using (MATLAB R2010a) RAM : 6GB OS: win7/64bit CPU : Intel® Core™ i3 CPU M330 @ 2.13GHz 2.13GHz

 채택된 답변

Jan
Jan 2011년 11월 21일
This:
r = ones(16777216)
tries to create a [16777216 x 16777216] matrix. Use this instead:
r = ones(1, 16777216)
See: help ones

댓글 수: 1

ohh,
long time didnt use the matlab, already forget the commands,
:)
thanks

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

질문:

2011년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by