Copy of MatLabAssignment1

Copy of MatLabAssignment1 - MATLAB Assignment 1 Exercise...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
-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])
Background image of page 2
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:
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online