MATLAB: Deleting a certain variable in the base workspace via a function

base workspace variableevalinexport2wsdlg

hi, assume i have the variable x in the base workspace.
I want to delete that variable x via a function. How can I accomplish this?
thanks

Best Answer

Try
evalin( 'base', 'clear(''x'')' )
and simpler
evalin( 'base', 'clear x' )
But take the advice of Image Analyst seriously