Out of memory error with zeros()
2 views (last 30 days)
Show older comments
I'm having a strange problem where when I run
nrg=zeros(120001);
I'm getting an out of memory error, but if I have an array, say t, that is the same length and I do
nrg=t*0;
it has no trouble creating the array.
Thoughts?
Accepted Answer
the cyclist
on 16 Feb 2013
Edited: the cyclist
on 16 Feb 2013
That syntax will try to create a 120001 X 120001 array. That's pretty big. :-)
Guessing you wanted
>> nrg = zeros(120001,1)
This mistake was the highest-voted one in the thread "Dumb mistakes we make with MATLAB": http://www.mathworks.com/matlabcentral/answers/1759-dumb-mistakes-we-make-with-matlab
1 Comment
More Answers (1)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!