How can I reduce the amount of memory use in drawing millions of rectangles?

1 view (last 30 days)
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
Pilkyung
Pilkyung on 13 Aug 2013
Approximately 8 inch. So, I need 2400 to 4800 pixels in both lateral and vertical directions.
Walter Roberson
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.

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!