- Add a property to your app that stores a logical scalar (1/0) with an initial value of 0 (false) (example of declaring a property)
- In the Button A callback function, set the new property to True.
- In the Button B callback function, check whether the new property is True of False and act accordingly. Perhaps you'd like to return the property value back to False at the end of the Button B callback function.
Check if button was pressed in Matlab AppDesigner
38 ビュー (過去 30 日間)
Adam Danz 2022 年 9 月 19 日
You've got button A and button B.
When the user presses button B, you want different actions depending on whether button A was already pressed or not, correct?
Follow these steps:
その他の回答 (1 件)
Eric Delgado 2022 年 9 月 19 日
Another idea is to use "statebutton" instead "button" to get a more user-friendly GUI. And you can use just one callback to get more code readability. See code attached made on R2021b (if you are working on a different release of Matlab, you have to open App Designer and save the file before run it).