Matlab gui coding

  • MATLAB
  • Thread starter phillyj
  • Start date
  • #1
30
0
Hi, I'm working on a currency converter and have some trouble trying to understand how to do the callback function. What I have is 2 menus with source and target currency. I also have an edit box to enter the amount. I have to press a convert button and the output is displayed in another text box.

I'm not sure where to start. Do I have to make multiple functions? I'm still new to gui building and only had one lecture. Is this complicated or am I over-thinking this?

Thanks
 

Answers and Replies

  • #2
MATLABdude
Science Advisor
1,655
4
A callback function is a function that's triggered upon an action in a GUI, e.g. a button press. For something like this, your callback would be something triggered on the button press to convert the user input to the output currency.

It's been a while since I used it, but as I recall, when you design your GUI and lay down a button in the GUI Creator, MATLAB should automatically give you a (fairly blank) template code block in the .m file associated with the GUI you're building. The following tutorial takes you through a similar task (creation of a basic adding machine):
http://blinkdagger.com/matlab/matlab-gui-graphical-user-interface-tutorial-for-beginners/

Good luck!
 

Related Threads on Matlab gui coding

Replies
6
Views
3K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
0
Views
6K
Replies
1
Views
7K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
6
Views
22K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
0
Views
2K
Replies
5
Views
969
  • Last Post
Replies
3
Views
2K
Top