フィルターのクリア

Drop down controls not displaying their default values when live script is run

6 ビュー (過去 30 日間)
Paul
Paul 2022 年 12 月 5 日
回答済み: T.Nikhil kumar 2024 年 4 月 15 日
I have a script with two drop downs and each drop down has a default value set. When I run the script the drop down shows their last used values.
I have tried clearing my workspace before running the script but that makes no difference.
How can I ensure that the controls display their default values, or set them to their default values each time the script is run?
MATLAB seems to be remembering the last used values even if I close and re-open MATLAB before running the script.

回答 (1 件)

T.Nikhil kumar
T.Nikhil kumar 2024 年 4 月 15 日
Hello Paul,
From what I understand, you want to set the dropdowns to their default values each time you run the script.
Currently, I do not think there is a straightforward way to achieve this in run time. A possible workaround could be to manually restore default values of each dropdown before you run the script. You can restore default value of a control by right clicking on the dropdown and selecting ‘Restore Default value’ option.
Follow this MATLAB Answer for updates regarding ways to restore default values of all controls using a single option - https://www.mathworks.com/matlabcentral/answers/1672669
Regards,
Nikhil

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by