How to implement switch-case statements/keypress functions in GUI? (such that when a button was pressed, it would run the commands like imread/imshow. I would like to assign 10 buttons for 10 different commands.)

10 views (last 30 days)
Good day! I have always tried coding switch-case statements but none of those worked for my GUI. I would like to ask for an advice on how to construct simple switch-case statement in GUI that would generate the functions under specific buttons/when a certain keyboard button was pressed. For an example, when the user pressed '1', then the program would display an image. When the user pressed '2', then the program would do another function.

Answers (1)

Walter Roberson
Walter Roberson on 20 Aug 2015

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!