Copy of MatLabAssignment1

# Copy of MatLabAssignment1 - MATLAB Assignment 1 Exercise...

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

MATLAB Assignment 1 Exercise 1.1 Code: log (20) / log (8) ans = Output: 1.4406 Exercise 1.2 Code: m = -3:0.4:12 Matlab adds 0.4 to the result of every single variable ranging from -3 and ending until it reaches 12. The function m(26) is the 26 th function of the code that adds .4 to -3 and to each consecutive result until it reaches the 26 th term. Exercise 1.3 Code: z = 25-(100-7*exp(5+cos(pi/3))) Output: z = 1.6378e+003

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

View Full Document
-10 -8 -6 -4 -2 0 2 4 6 8 10 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Exercise 1.4 Graph the function g ( x ) = sin( x )/ x on the interval [-10, 10] with fplot . Code: f= inline('sin(x)/x') f = Inline function: f(x) = sin(x)/x Code: fplot (f, [-10, 10])
Exercise 1.5 (a) Recall that a geometric sequence is a sequence of the form a , ar , ar 2, ar 3 , . .. At the MATLAB command prompt (not in an M-File), create a for-loop which prints the first 7 terms of this sequence when r = 1/3, a = 1. Code:

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.

## This note was uploaded on 06/04/2010 for the course MATH MATH 20D taught by Professor Staff during the Winter '09 term at UCSD.

### Page1 / 7

Copy of MatLabAssignment1 - MATLAB Assignment 1 Exercise...

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

View Full Document
Ask a homework question - tutors are online