how to clear variables when exit aplication?
3 次查看(过去 30 天)
显示 更早的评论
How can i clear all variables on click X button???
0 个评论
回答(1 个)
Image Analyst
2014-12-14
You can do
clear all;
or
clearvars;
Though when it leaves the button callback function it will clear everything anyway without calling clear. If you put that in a script rather than a function, it will clear variables in the base workspace.
6 个评论
Image Analyst
2014-12-28
I see no reason why your program will run again when you exit it. Perhaps did you double-click the run button, or hits F5 twice, when you launched it? Otherwise we'd have to see the code. All I know is that my programs don't run again once I shut them down.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!