How To Get A? Essay

3423 WordsDec 14, 201114 Pages
GUI with Matlab: A Tutorial 1. Introduction * Matlab GUI vs others * Similar to RAD such as C++ builder and VB * Most GUI work across platforms * Can perform most functions as traditional GUI through tricks * Can link platform dependent code using MEX programs * Problems with GUI * Not as flexible * Cross platform appearance may not be the same * Often must use tricks and unfriendly techniques * MEX code GUI eliminates cross platform operation 2. GUI elements * GUI elements are treated as objects. They encapsulate data and method. * Menu: uimenu * Controls: pushbutton, checkbox, radio buttons, text (static), slider (scroll bar), edit (interactive), listbox, popupmenu, frame : uicontrol * Graphics: plots, text, axis, image, surface, shading : axes, image, line, patch, surface, text, light * Others: almost all visible elements on screen except command window : e.g., msgbox 3. Finding out more about GUI elements * Use "helpdesk" * launch default web browser, usually Netscape * enter "helpdesk" from matlab prompt. Click on handle graphics objects * Experiment with properties * example: create a plot and enter "set(gcf),pause,set(gca)" * "get" only shows the properties, "set" can set and show * Try "guide", "cbedit", "toolpal", "aligntool"; good for simple GUI generation * "guide" is the mother of all tools 4. Simplest GUI: message box * Simple syntax: msgbox(message,title,'modal' or 'nonmodal') * Used to pop up a dialog box with Ok button on it * Message and title are strings; title is optional, default is 'nonmodal' * For example, msgbox('I am afraid I CAN do that, Mik.') * Other types of message boxes are * errordlg(message,title,'modal' or 'nonmodal'): msgbox with error icon *

More about How To Get A? Essay

Open Document