Linking GUI in MATLAB

2 views (last 30 days)
SDJ
SDJ on 17 Jan 2016
Commented: SDJ on 17 Jan 2016
I am trying to program a game of tic tac toe in MATLAB I have 3 GUI setup. The first one asks the player to choose "X" or "O", the second, asks who wants to go first "player" or "computer" and the third is the board. How do I link the three and code matlab to remember the choices?

Accepted Answer

Image Analyst
Image Analyst on 17 Jan 2016
Why make your UI complicated by having three separate GUIs running? Just make one full screen GUI and put all your buttons and things on that. It will also be a lot easier to communicate between functions.
If you still want to do it this klunky, more complicated way with multiple GUIs then see the latter part of this FAQ entry: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
  1 Comment
SDJ
SDJ on 17 Jan 2016
Thank you for your reply and you're right. I think I'll do that but I'm finding it harder to show images for x and o depending on who's turn it is and whether it's x or o.

Sign in to comment.

More Answers (0)

Categories

Find more on Strategy & Logic in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!