PDA

View Full Version : matlab gui coding


phillyj
Nov10-10, 10:51 AM
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

MATLABdude
Nov12-10, 04:19 AM
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!