2a_User_defined_function(power point)

2a_User_defined_function(power point) - ENGR132 Class 2A...

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

View Full Document Right Arrow Icon
Click to edit Master subtitle style 2/21/11 ENGR 132 Transforming Ideas to Innovation II Class 2A: User-defined Functions 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
2/21/11 Quiz 2A 22 1. Write the Matlab command to: a) Create a vector t that goes from 0 to 100, with an increment of 0.5. b) Evaluate the following equation: Use the above t and assume u and a are defined. 1. Write the Matlab command to: a) Define the following matrix: 2 2 1 at ut s + = = 1 6 8 9 5 2 A
Background image of page 2
2/21/11 Learning Objectives for Today 33 What are user-defined functions? Why create user-defined functions? How to create user-defined functions? How to use user-defined functions?
Background image of page 3

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

View Full DocumentRight Arrow Icon
2/21/11 Matlab Functions 44 What are some of the Matlab functions we have used? Ex: sin, exp, plot, max General form for calling a function [output1, output2, …] = function_name(input1, input2, …) Ex: [max_value, max_index] = max(xdata) What are some characteristics of Matlab functions? Usually have inputs
Background image of page 4
2/21/11 Matlab Functions 55 What is behind a Matlab function? What does the source code to a Matlab function look like? Input s Functio n Outputs ???
Background image of page 5

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

View Full DocumentRight Arrow Icon
2/21/11 What are user-defined functions? 66 A function that is created by the user Created in the Matlab editor and saved as a .m file Used just like any other Matlab functions The .m file has to be located in the current directory
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/20/2011 for the course ENGINEERIN 132 taught by Professor Lee during the Spring '11 term at Purdue.

Page1 / 20

2a_User_defined_function(power point) - ENGR132 Class 2A...

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

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