diary20050209

diary20050209 - / 2 clc f = inline('sign(x-.873) *...

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

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

This note was uploaded on 12/27/2011 for the course CMPSC 110a taught by Professor Gilbert during the Fall '09 term at UCSB.

Ask a homework question - tutors are online