Introduction to matlab
Download
1 / 27

Introduction to MATLAB - PowerPoint PPT Presentation


  • 644 Views
  • Updated On :

Introduction to MATLAB Lecture 3: Data Visualization & User Interfaces Damon Tomlin February 22, 2008 A quick word about SPM . . . This can be a little intimidating . . . “Any sufficiently advanced technology is indistinguishable from magic.” -- Arthur C. Clarke, possibly describing SPM

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Introduction to MATLAB' - issac


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Introduction to matlab l.jpg

Introduction to MATLAB

Lecture 3: Data Visualization & User Interfaces

Damon Tomlin

February 22, 2008


A quick word about spm l.jpg
A quick word about SPM . . .

This can be a little intimidating . . .


Any sufficiently advanced technology is indistinguishable from magic l.jpg
“Any sufficiently advanced technology is indistinguishable from magic.”

-- Arthur C. Clarke, possibly describing SPM

  • SPM is three things:

    • Some functions that work on numbers (your data)

    • Some functions that display the crunched numbers

    • A bunch of buttons that run the functions when you press them


Overview of matlab graphics l.jpg
Overview of MATLAB Graphics from magic.”

  • Figures

  • Axes

  • UI Objects

  • Handles

    • If you can see it, it has a handle.

    • Some things you can’t see have handles, too.

    • Use handles to manipulate properties.


Handles properties l.jpg
Handles & Properties from magic.”

  • Figures, axes, and graphics have handles, just like files

  • These objects have properties

  • These properties can be altered


How many ways can we look at data l.jpg
How many ways can we look at data? from magic.”

  • 2D line plots

  • Pseudocolor Images

  • Histograms

  • 3D shapes


2d plots l.jpg
2D Plots from magic.”

  • plot(x,y);

  • plot([x1 x2 x3],[y1 y2 y3]);

  • plot(x1,y1,’r.’,x2,y2,’b-’);


Images l.jpg
Images from magic.”

  • imagesc

    • Pseudocolor

    • Colormaps

  • image

    • M x N x 3 matrix


Histograms l.jpg
Histograms from magic.”

  • hist

    • designate bins

  • bar

    • generic bar graph


3d visualization l.jpg
3D Visualization from magic.”

  • Surface plots

    • Color

    • Transparency

  • Mesh plots

  • 3D shapes


Making visualizations more informative l.jpg
Making Visualizations More Informative from magic.”

  • xlabel, ylabel, zlabel

  • title

  • legend


Other handy functions l.jpg
Other handy functions from magic.”

  • subplot(rows,columns,number)

  • Axis([xmin xmax ymin max])

  • set(handle,’PropertyName’,value, . . .);

  • get(handle,’PropertyName’)


What s a graphical user interface gui l.jpg
What’s a Graphical User Interface? (GUI) from magic.”

  • Figure windows

  • Buttons, menus, sliders, etc.

  • Appearance changes depending on inputs & outputs

  • Eliminates command line typing


Demystifying gui s l.jpg
Demystifying GUI’s from magic.”

  • Interface objects have properties

    • Style – type of object

    • String – text associated with object

    • Callback – what the object does

    • Value – current value of object

  • What these properties mean depends on the type (Style) of object created


Ui styles buttons l.jpg
UI Styles: Buttons from magic.”

  • Buttons cause commands to be executed

  • Style – pushbutton

  • String – text on the button

  • Callback – string containing command(s) executed by button

  • Value – not important


The eval function l.jpg
The Eval Function from magic.”

  • Executes a string as though it were a command typed into a command window or function

  • Example 1: eval(‘disp(a);’);

  • Example 2: eval([‘save ‘ FileName ‘ a b;’]);


Callbacks and eval l.jpg
Callbacks and Eval from magic.”

  • Callbacks are assigned within functions

  • Callbacks are executed outside functions

    • (usually)

  • Therefore, any variables a callback needs have to be stored somehow.


Ui styles radio buttons l.jpg
UI Styles: Radio Buttons from magic.”

  • Style – radiobutton

  • String – text on the button

  • Value – whether button is pushed in or out

  • Callback – exclusivity code & additional functions

  • Used in sets for mutually exclusive, boolean options


Ui styles check boxes l.jpg
UI Styles: Check Boxes from magic.”

  • Style – checkbox

  • String – text on the box

  • Value – whether button is checked

  • Callback – often nothing, unless switching the option’s value executes a function

  • Used for boolean options


Ui styles edit windows l.jpg
UI Styles: Edit Windows from magic.”

  • Style – edit

  • String – text in the box

  • Value – not used

  • Callback – function executed when Enter key is pressed

  • Used for typed inputs of names & values


Ui styles slider bars l.jpg
UI Styles: Slider Bars from magic.”

  • Style – slider

  • String – not used

  • Value – position of slider – between Max and Min

  • Callback – function executed when slider is moved

  • Used when a variable can take on a spectrum of values


Ui styles text boxes l.jpg
UI Styles: Text Boxes from magic.”

  • Style – text

  • String – text in the box

  • Value – not used

  • Callback – not used

  • Used for displaying information, entitling portions of a GUI


Ui styles frames l.jpg
UI Styles: Frames from magic.”

  • Style – Frame

  • String – not used

  • Value – not used

  • Callback – not used

  • Used for grouping other objects visually


Ui styles list boxes l.jpg
UI Styles: List Boxes from magic.”

  • Style – listbox

  • String – cell array of each possible choice

  • Value – currently highlighted selection

  • Callback – function executed when an item is selected

  • Used for selecting options when their names and numbers may change


Ui styles pop up menus l.jpg
UI Styles: Pop Up Menus from magic.”

  • Style – popupmenu

  • String – cell array of each possible choice

  • Value – currently selected option

  • Callback – function executed when an item is selected

  • Used for selecting options in a more compact manner


Useful functions l.jpg
Useful Functions from magic.”

  • set – change something’s properties

  • get – find out what something’s properties

  • guidata – attach data to/pull data from GUI


Summary l.jpg
Summary from magic.”

  • MATLAB has lots of functions to help you look at your data

  • You can connect functions to GUI’s so you don’t have to type as much

  • As we’ll see, this is exactly what SPM does.


ad