how to remove all variables in the workspace
Show older comments
Hi, I try to remove/clear all the variables in the work space. But not typing clear on the command window. I try to add clear at the beginning of the my code. but it doesnt work. is there any way to add clear or any other way to clear workspace when i run mycode
Answers (2)
newVar = 42
newVar = newVar + 3
clear newVar
newVar
Image Analyst
on 3 Sep 2013
Edited: Image Analyst
on 3 Sep 2013
0 votes
Try "clearvars" or "clear all" as a line in your script. Do not do this in a function that takes input arguments or else you will blow them away!!!
Categories
Find more on MATLAB 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!