フィルターのクリア

Enabling push button after an error occurred?

1 回表示 (過去 30 日間)
Raju Kumar
Raju Kumar 2022 年 6 月 7 日
コメント済み: Raju Kumar 2022 年 6 月 10 日
Hello Matlab experts,
I have issues with push buttons in matlab app designer. When I perform a task using a push button and everything goes smoothly, the push button retruns to normal (meaning enabled automatically). However, when any errors occur midway (of any kind), the same push botton keeps on disabled. How do I avoid this situation? I mean how to enable the button when there is an error during processing? Can anybody help me on this. A big thanks in advance.
Raju

採用された回答

Jan
Jan 2022 年 6 月 7 日
Matlab stops, when an error occurs. If it does not run anymore, it cannot modify buttons.
The solution is to catch errors:
try
... your Code which might fail
catch ME
warning('A problem occured: %s', ME.message);
end
Now a warning appears and Matlab proceeds working.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by