05_CM0268_MATLAB_GUIs

05_CM0268_MATLAB_GUIs - CM0268 MATLAB DSP GRAPHICS 1 128 JJ...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CM0268 MATLAB DSP GRAPHICS 1 128 JJ II J I Back Close MATLAB GUIs We conclude our brief overview of MATLAB by looking at : Brief introduction to MATLAB GUI building. CM0268 MATLAB DSP GRAPHICS 1 129 JJ II J I Back Close MATLAB GUIs Building a GUI in MATLAB is pretty straight forward and quick. You can create a GUI by hand. Use MATLABs GUI Development Environment (GUIDE) to assist you Predefined GUI Dialog Boxes MATLAB Provides a variety of dialog boxes that are ready made for you to use: Simple uicontrol objects : errordlg , helpdlg , msgbox , warndlg , inputdlg and questdlg pretty self explanatory. File/Directory Chooser : uigetfile Font and Colour Choosers : uisetfont and uisetcolor CM0268 MATLAB DSP GRAPHICS 1 130 JJ II J I Back Close The Error Dialog box: errordlg To create an error dialog you do something like this: errfig = errordlg(You have made an Error!,User Error,... replace); This creates: Note: The first string specifies the main error dialog text. The second string specifies the dialog window title text. The third string specifies as CREATEMODE which when set to replace forces MATLAB to use only one error window with the same title do not create another one if exists. CM0268 MATLAB DSP GRAPHICS 1 131 JJ II J I Back Close The Warning Dialog box: warndlg To create a warning dialog you do something like this: warnfig = warndlg(Warning: Somethings not right!, Warning); This creates: Note: The first string specifies the main error dialog text. The second string specifies the dialog window title text Use to get a character in a string CM0268 MATLAB DSP GRAPHICS 1 132 JJ II J I Back Close The Help Dialog box: helpdlg To create a help dialog you do something like this: helpfig = helpdlg(You need Help!); This creates: Note: The string specifies the main error dialog text. An optional second string could specify the dialog window title text often unnecessary. CM0268 MATLAB DSP GRAPHICS 1 133 JJ II J I Back Close The Message Dialog box: msgbox Error, Warning and Help dialogs are all special cases of a msgbox , E.g. : errfig = msgbox(You have made an Error!,User Error,error); warnfig = msgbox(Warning: Somethings not right!, Warning, ... warn); helpfig = msgbox(You need Help!,Help Dialog,help) All achieve same as above. It is more general and can just create a general message: msgfig = msgbox(This is a Message,Msg); CM0268 MATLAB DSP GRAPHICS 1 134 JJ II J I Back Close Customised Message Dialog Icons You can even be used to create a message with a customised icon with the format: msgbox(Message,Title,custom,IconData,IconCMap) E.g. : Data=1:64;Data=(Data * Data)/64; msgfig =msgbox(String,Title,custom,Data,hot(64)); CM0268 MATLAB DSP GRAPHICS 1 135 JJ II J I Back Close The Question Dialog Box: questdlg To create a question dialog you do something like this:...
View Full Document

This note was uploaded on 01/24/2012 for the course CM 0268 taught by Professor Davidmarshall during the Winter '11 term at Cardiff University.

Page1 / 29

05_CM0268_MATLAB_GUIs - CM0268 MATLAB DSP GRAPHICS 1 128 JJ...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online