Using clearvars correctly in MATLAB
This works: clearvars '*' -except d
Matlab must have a problem converting *
into a string when it's on its own. It's fine with both a*
and *a
, but not *
.
Also, this works:
clearvars('*', '-except', 'd')
The *
character is not needed.