??? 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 件のコメント

tahseen
tahseen 2011 年 11 月 22 日
ohh,
long time didnt use the matlab, already forget the commands,
:)
thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix 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