{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ENGR132_Class2A_Knutson

# ENGR132_Class2A_Knutson - Welcome to ENGR132 Transforming...

This preview shows pages 1–10. Sign up to view the full content.

Click to edit Master subtitle style ENGR132 Transforming Ideas to Innovation II Prof. Amanda Knutson and GTA Ben Ahn Class 2a Welcome to

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

View Full Document
4/24/11 Announcements Section 006 homework is due TUES Jan 25th Section 021 homework is due FRI Jan 21st Be sure to complete the project component of the Homework – section 2.2 in blackboard Read the project description and look at the grading rubrics for each milestone (posted under the MEA & Project folder on the homepage) 22
4/24/11 Review of Activities from 1B To define vectors/matrices - use spaces or commas for row vectors, semicolons for column vectors) Can add a scalar to a vector, multiply a vector by a scalar – works element by element Can only add vectors of same length/orientation Use dot notation (.*, ./, .^) for element by element vector operations When you use the dot notation, the vectors must have the same length and same 33

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

View Full Document
4/24/11 Review of Activities from 1B Assume a matrix A has been defined in Matlab – you can access matrix elements two ways A(row#, column#) A(element number) You can access an entire row by using A(row#, :) You can access an entire column by using A(: , col#) The : here means all 44
4/24/11 Plotting in Matlab What things are needed to make a plot acceptable for technical presentation? Labels, title, legend, units If you are plotting data stored in two vectors, do the vectors have to be the same length? Do they both have to be row/both column vectors? Vectors must be the same length, can be row or column vectors When do you use markers vs a line Markers for experimental data, lines for 55

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

View Full Document
4/24/11 Learning Objectives: User-Defined Functions At the end of this topic, you will be able to: Explain what a user-defined function is in MATLAB Describe at least two reasons why we create MATLAB user-defined functions Identify the essential elements of a MATLAB user- defined function Describe how to pass variables to and from a MATLAB user-defined function 66
4/24/11 Functions: remember morphological analysis? Below is a simple view of the overall function of a washing machine The box, representing the function, has inputs, outputs, and “stuff that goes on inside the box” WA SH Dirty clothes Clean clothes 77

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

View Full Document
4/24/11 Functions in MATLAB MATLAB functions are similar in that they have: Input Arguments – these are variables (scalars, vectors, matrices, character strings…) Outputs Arguments – these are variables (scalars, vectors, matrices, character strings…) Operations on the Input Arguments Approximate Taylor series Angle Sine of angle Function Operates on Input(s) Input(s) Output(s) 88
4/24/11 Functions in MATLAB The format of a function requires that we keep track of input arguments, output arguments, and the function code itself (the stuff in the box) >> x = [3 5 7 9 10] >> y = mean(x) Approximate Taylor series Angle Sine of angle mean function set of data mean value of data input output 99

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 37

ENGR132_Class2A_Knutson - Welcome to ENGR132 Transforming...

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

View Full Document
Ask a homework question - tutors are online