anyway to clear variable in Matlab workspace from app?
64 ビュー (過去 30 日間)
Yu Li 2019 年 8 月 31 日
コメント済み: Walter Roberson 2023 年 4 月 19 日
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.
Adam Danz 2019 年 8 月 31 日
編集済み: Adam Danz 2019 年 8 月 31 日
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 2019 年 8 月 31 日
evalin('base', 'clear VARIABLENAME')
Walter Roberson 2023 年 4 月 19 日
I would also like to ask you, how can I list in the dropdown the variable that are created within the matlab.app application and not those that are in the base WS?
You can use properties to find the list of variables for the app object.
You will find that in practice most of them should not be eligible for clearing.
その他の回答 (1 件)
R.G. 2019 年 8 月 31 日
To clear variable use 'clear' function instead, ex:
where 'v' is variable name.
Find more on Whos 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!