{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

diary20050209

# diary20050209 - 2 clc f = inline'sign(x.873 sqrt(abs(x.873...

This preview shows page 1. Sign up to view the full content.

% Matlab diary from cs110a, Feb 9 2005. % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. f f = Inline function: f(x) = x^3+sin(x)-5 fprime fprime = Inline function: fprime(x) = 3*x^2+cos(x) ezplot(f,[0,2]) x = 1 x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) f(x) sqrt(10) x = 10 x = (x + 10/x) / 2 x = (x + 10/x) / 2 x = (x + 10/x) / 2 x = (x + 10/x) / 2 x = (x + 10/x) / 2 x = (x + 10/x) / 2 x = (x + 10/x)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: / 2 clc f = inline('sign(x-.873) * sqrt(abs(x-.873))') ezplot(f) f(.873) f(.8) f(.9) fprime = inline('(sign(x-.873) * sqrt(abs(x-.873))) / (2*(x-.873))') x=2 x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = 1 x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) x = x - f(x)/fprime(x) fprime phi = (1+sqrt(5))/2 fzerogui(f, [ 0 2])...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online