This preview shows pages 1–6. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 14:440:127 Introduction to Computers for Engineers Recitation 8 Lecturer: Blase E. Ur Recitation Instructor: Bo Jin Recitation Instructor: Cyrus Gerami Recitation Instructor: Vishnu Vijayakumar Recitation Instructor: Wen Yueh 14:440:127 Recitation 8 Animation % X floating through space for t=0:0.1:20 % choose a small interval x=t*cos(t); y=5*sin(t); pause(0.05) % can come anywhere in the loop Rutgers University School of Engineering pause(0.05) % can come anywhere in the loop plot(x,y,'X') axis([20 20 5 5]) % must follow plot end 14:440:127 Recitation 8 User Defined Functions In an mfile, which has the same name as your function First line; function [OUTPUT] = NAME(INPUT) Rutgers University School of Engineering 14:440:127 Recitation 8 Sum and product function [s p] = sumAndProduct(x,y) % Here is my help function s = x+y; p = x*y; % this is just a normal comment Rutgers University School of Engineering 14:440:127 Recitation 8 Variable Scope M files that aren’t functions and the command window share the...
View
Full
Document
This note was uploaded on 01/11/2010 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.
 Fall '09
 blase

Click to edit the document details