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.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 12 Apr. 2016

0 Stimmen

builtin('clear','clear')

1 Kommentar

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Steven Lord
Steven Lord am 12 Apr. 2016

0 Stimmen

There are a number of techniques suggested in this posting on Loren's blog.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 12 Apr. 2016

Kommentiert:

am 12 Apr. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by