Figure taking up too much ram and sometimes crashing.
7 views (last 30 days)
Show older comments
I am doing pretty big basins of attraction, and every time I create them, they end up being really slow and taking up a ton of ram. It will take a few minutes for me to be able to save them, and then it will take much more for it to end up saving. One time, it crashed and Matlab offered a package that I could download to help process the figure better, but I cannot seem to find it. I could also scale down the basins, but they look nice and help distinguish well.
I would appreciate if somebody knew what package could help with this.
0 Comments
Accepted Answer
Angelo Yeo
on 16 Aug 2023
I believe one of the options you can take is to save the figure to disk without rendering the figure window. Please refer to the code below and see if it would be a good option for you.
h = figure('Visible','Off'); % Creating a figure and not displaying it
ax = axes; % Create an Axes;
plt = plot(ax,1:10,1:10,'r'); % Plot an arbitrary line in the axes
set(h,'CurrentAxes',ax); % Set current Axes of figure to 'ax'
print(h,'-djpeg','fname.jpeg')% Print the plot to file 'fname.jpeg'
% exportgraphics(h, 'myfilename.png'); % An alternative for "print".
0 Comments
More Answers (0)
See Also
Categories
Find more on Printing and Saving in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!