GUI Pushbutton using GUIDE

조회 수: 3 (최근 30일)
jake harris
jake harris 2018년 12월 6일
답변: Cris LaPierre 2018년 12월 7일
Hi everybody, Im looking to add a GUI to my code in the form of a push button menu. I need 4 buttons with each button correcspoding to an ouput:
Here is a brief summary of my code currently.
1 - scenario 1 (tells user what each option is)
2 - scenario 2
3 - scenario 3
4 - scenario 4
Please enter the option you want : (user enters 1, 2, 3 or 4)
If choice = 1
Plots graph
elseif choice = 2
Plots graph
elseif choice = 3
Plots graph
elseif choice = 4
Plots graph
end
How do I add a GUI to show the 4 scenarios as push buttons which when pressed, start the corresponding if statement??
Thanks in advance

답변 (1개)

Cris LaPierre
Cris LaPierre 2018년 12월 7일
Guis execute callback functions. The most straightforward way to do this is to have the callback function for each button plot the corresponding graph. No need for an if-statement.
You can read more about writing callbacks in GUIDE here.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by