anyway to clear variable in Matlab workspace from app?
70 views (last 30 days)
Show older comments
Yu Li on 31 Aug 2019
Commented: Yu Li on 1 Sep 2019
is there anyway to clear variable in Matlab workspace from app designer?
an workaround I know is to use 'assign' function, to assign an empty value to that variable. but I want know how to clear it.
Edited: Adam Danz on 31 Aug 2019
There is rarely a need to clear variables from within a function but sometimes it useful to do so. There should never be a need to clear variables in a different workspace. Without knowing more about what you're doing, the best help I can offer is trying to clean up any reasons why someone would need to do this in the first place.
What workspace is the variable in (the base workspace?), how did it get there, and why does it need to be cleared from within a function (which has its own workspace).
Walter Roberson on 31 Aug 2019
evalin('base', 'clear VARIABLENAME')
More Answers (1)
R.G. on 31 Aug 2019
To clear variable use 'clear' function instead, ex:
where 'v' is variable name.
Find more on Entering Commands 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!