Beruflich Dokumente
Kultur Dokumente
http://www.intelligent-systems.info/classes/ee509/gui.htm
HOME
1 of 6
15-01-2012 10:08
http://www.intelligent-systems.info/classes/ee509/gui.htm
Resize the design window. Using the pallette on the left, drag and drop, resize and position the canvas, buttons, and static text windows.
Double-click on an object to open the properties dialog. Change the captions on the buttons and remove "Static Text" string from the text window. Set the font size 30
2 of 6
15-01-2012 10:08
http://www.intelligent-systems.info/classes/ee509/gui.htm
The GUI is finished. Save the work. The rest of the design process will take care of the functionality provided by each GUI component.
3 of 6
15-01-2012 10:08
http://www.intelligent-systems.info/classes/ee509/gui.htm
Open the matlab editor by typing >>edit foo.m where foo.m is the name of your design Each time you press a button, a callback function is executed. For example, in this particular case, a click on button "1" will call the following function:
This function will have to be modified to provide required functionality. Buttons "0"-"9","+","-","*","/" will add corresponding symbol to the text string displayed on the top. For button "1" the code will look like:
4 of 6
15-01-2012 10:08
http://www.intelligent-systems.info/classes/ee509/gui.htm
Do the same for the rest of the buttons, except "=". The "=" button should evaluate the text string in the text window and return the result.
Now the calculator is ready to use. Of course, it misses a lot of functionality, but
5 of 6
15-01-2012 10:08
http://www.intelligent-systems.info/classes/ee509/gui.htm
6 of 6
15-01-2012 10:08