MATLAB Answers

>> clear = 3

1 view (last 30 days)
Kevin
Kevin on 12 Apr 2016
Commented: Kevin on 12 Apr 2016
Assume that I accidentally type the following command in MATLAB,
>> clear = 3
This will create a variable called "clear" in the base workspace. Now how do I clear this variable?
Assuming that I don't want to close MATLAB and start MATLAB again.

  0 Comments

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 12 Apr 2016
builtin('clear','clear')

  1 Comment

Kevin
Kevin on 12 Apr 2016
Very nice and clean solution.

Sign in to comment.

More Answers (1)

Steven Lord
Steven Lord on 12 Apr 2016
There are a number of techniques suggested in this posting on Loren's blog.

  0 Comments

Sign in to comment.