How can I reduce the amount of memory use in drawing millions of rectangles?
1 view (last 30 days)
Show older comments
Hi,
I am drawing 2D rectangles in matlab by rectangle() command. As the number of rectangles increases to million (or to billion), I can see the amount of memory use exceeds several gigabytes.
So, the question is, how can I draw rectangles without considerably increasing the amount of memory? Or, if it is possible, could you show me the way to plot directly to eps file without plotting to figure window?
Sincerely, Moon
5 Comments
Walter Roberson
on 13 Aug 2013
At 4800 x 4800 and a billion rectangles, you are averaging only 0.02 pixels per rectangle (under the assumption they are not overlapping.)
4800 x 4800 and a million rectangles gives a more plausible 23 pixels average per rectangle, but 2400 x 2400 and a million would be down to only a little over 5 pixels average per rectangle.
Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!