How can I use a switch in AppDesigner to call different functions?

조회 수: 9 (최근 30일)
xX_MatlabMaster_Xx
xX_MatlabMaster_Xx 2017년 11월 28일
답변: Mukul Rao 2017년 12월 5일
Hi,
I've got two functions in the callback of a button in appdesigner. Moreover I've got a toggle swtich that can have to states.
I want that, depending on the state of the switch, the button runs one of the functions. Would this work with a 'if' statement for the swtich value/state inside the button callback ? If yes, how?, If no, how as well?:)
Thank you very much!

채택된 답변

Mukul Rao
Mukul Rao 2017년 12월 5일
Hi, you can basically call one of the two functions within the button callback based on the state of the toggle switch (app.ToggleSwitch.Value). I've attached a very rudimentary example illustrating this.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Desktop에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by