ENGR132_Class11A_Knutson

ENGR132_Class11A_Knutson - ENGR132 Class 11A Introduction...

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

View Full Document Right Arrow Icon
Click to edit Master subtitle style 4/24/11 ENGR 132 Transforming Ideas to Innovation II Class 11A: Introduction to Matlab GUI 11
Background image of page 1

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

View Full DocumentRight Arrow Icon
4/24/11 Learning Objectives for Today 22 Basic Matlab data type Matlab GUI toolbox How to develop a GUI Designing the layout of the GUI Writing the codes that determine how the GUI works
Background image of page 2
4/24/11 Matlab Data Type 33
Background image of page 3

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

View Full DocumentRight Arrow Icon
4/24/11 Matlab Data Type 44 Command to determine data type whos – data type of all variables in workspace class(x) – data type of x isnumeric(x) – check if x is numeric ischar – check if x is a string (a bunch of characters) Convert from numeric to string y = num2str(x) x is a number, y is a string representation of a number
Background image of page 4
4/24/11 Matlab Data Type 55 Convert from string to numeric y = str2num(x) x is a string representation of a number, y is a number E.g. x = ‘123’, y = 123 If a string variable is NOT a representation of a number: x = ‘cat’, y = str2num(‘cat’) Matlab returns an empty variable
Background image of page 5

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

View Full DocumentRight Arrow Icon
4/24/11 Introduction 66 GUI is event driven Pressing a screen button, typing in a string or numeric value GUI components available: Push button, slider, radio button, edit text, pop-up menu, list box, table, axes (plot), etc Each GUI consist of 2 files: fname.fig – layout of the GUI
Background image of page 6
4/24/11 WARNING - to Avoid Frustration…. 77 Save your code in a structured manner Example: Demo_v1, Demo_v2, Demo_v3, etc When you have a component working – change the version number (v1, v2, v3,…) If you code stops working – you can refer back to the last working version Avoid having to recreate the fig file and recode everything It is very common for students to make errors that
Background image of page 7

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

View Full DocumentRight Arrow Icon
4/24/11 Developing GUI 88 Two ways to develop GUI: Programmatically – start from scratch, code everything include layout of GUI (position, size, color, etc.) and functions Using GUIDE (Graphical User Interface Developing Environment) – suggested method Two step process using GUIDE: First step is to layout the components (design of the GUI). Saving the layout (fname.fig) will automatically generate
Background image of page 8
4/24/11 What does GUIDE create? 99 Default functions Matlab calls these Initialization Codes Automatically generated the first time a new GUI is created (and saved) Function definition for each component Automatically generated when a component is added (and saved) Variables
Background image of page 9

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

View Full DocumentRight Arrow Icon
4/24/11 Default Functions 1010 fname – GUIDE initialization task Do Not Edit fname_OpeningFcn – Performs initialization task
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/23/2011 for the course ENGR 132 taught by Professor Kutson during the Spring '11 term at Purdue.

Page1 / 35

ENGR132_Class11A_Knutson - ENGR132 Class 11A Introduction...

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

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