Thursday, November 6, 2008

GUI (Graphical User Interface) Design on Matlab

It is very easy to design a user interface (commonly called a form) on Matlab. Although the GUI items/components (such us button, textbox, combobox, chart, etc) are not as much as Borland Delphi or Microsoft Visual Studio, it is very comfortable for a "newbie" programmer (or tobe) to use Matlab GUI for their first initial learning about graphical programming. Here, Matlab offers a minimalist concept for us to build an interactive application.
This session will give step-by-step tutorial on how to start building a simple GUI form within Matlab environment.

1. As usually, run your Matlab.
2. Then go to File -> New -> GUI.


3. GUIDE Quick Start window will appear. There are two selection tabs, Create New GUI and Open Existing GUI. In this case, use Create New GUI. Since we will create a new blank GUI, then select Blank GUI (Default). Click OK button.

4. The new window with title "untitled1.fig" will be shown. This window contain a new form, and on this form we can put any GUI components.

5. From this point, we can run our new GUI application. Click Run button. This Run button is on the toolbar, on the top part of window.

6. The save confirmation dialog titled GUIDE will appear. You can either thick "Do not show this dialog again" or leave it blank, then click Yes button.

7. After you give the name of your application and save it on the disk, the m-file editor related to this new application will be opened, and a few second later your application should be run.

8. That is it, now we already have a new GUI application which contain only one form. In Matlab environment, GUI application produces 2 files: a figure file with .fig extension and a m-file with .m extension. Just check inside your folder where you save your GUI application.

Until this point, we do not write any code into our GUI application yet. We will have it on the next session of Matlab GUI Programming.
Thank you for visiting.