m_power
m_power

Reputation: 3204

Alernative to close all for debugging purposes

I'm trying to debug a script with memory problems. close all is resolving the problem. But I would like to find the place in the code where the problem is actually occurring. Is there an alternative to close all (like something that tells what close all is actually closing) to see what are the figures or else taking the most memory?

Upvotes: 1

Views: 76

Answers (2)

bas
bas

Reputation: 209

Use 'whos' to see memory usage. See here: http://www.mathworks.com/help/matlab/ref/whos.html

Upvotes: 0

HebeleHododo
HebeleHododo

Reputation: 3640

You can close a specific figure by passing the figure handle to close.

hFig1=figure;
hFig2=figure;

close(hFig1);

This will only close the first figure.

You can close your figures one by one while watching memory usage to understand which one is causing the problem.

Upvotes: 1

Related Questions