Figure taking up too much ram and sometimes crashing.

7 visualizaciones (últimos 30 días)
Derek
Derek el 16 de Ag. de 2023
Respondida: Angelo Yeo el 16 de Ag. de 2023
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.

Respuesta aceptada

Angelo Yeo
Angelo Yeo el 16 de Ag. de 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".
Note that exportgraphics was introduced in R2020a.

Más respuestas (0)

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by