{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

14-440-127 Recitation 7 Presentation

14-440-127 Recitation 7 Presentation - 14:440:127...

Info iconThis preview shows pages 1–4. 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 Document Right Arrow Icon

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

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

Unformatted text preview: 14:440:127 Introduction to Computers for Engineers Recitation 7 Lecturer: Blase E. Ur Recitation Instructor: Tianming Li Recitation Instructor: Ke Xu Recitation Instructor: Brian Viezbicke Recitation Instructor: Mingliang Wang Rutgers University SOE 14:440:127 Recitation 7 Functions • To call a function, you type: [out_1, out_2,…, out_m]=function_name(var1, var2,…., Var_n); var_1, var_2, …., var_n : input variables, arguments, formal parameters. Could have 0 argument. out_1, out_2, …, out_m : output variable, return values. Could have 0 output. • Examples – cos(pi/2), ss=sin(1.0) – [i, j] = find(A>0) Rutgers University SOE 14:440:127 Recitation 7 • FIRST LINE: • function [o1, o2,…,o_n] = NAME (in_1, in_2,…, in_3) Replace NAME with the function’s name • Save the file as NAME.m (or whatever the name of the function is) • Simple Example: function y = doubler (x) y = 2*x; User-Defined Functions input output Save this as doubler.m Function name Rutgers University SOE...
View Full Document

{[ snackBarMessage ]}

Page1 / 10

14-440-127 Recitation 7 Presentation - 14:440:127...

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

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