HW 4 Solution - ff = xf^2*abs(sin(xf))-4; if...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
6.11
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
SI a) >> format long >> x0=0.5; %Initial Guess >> x = fzero(@(x)x^2*abs(sin(x))-4,x0) x = 3.478508515574645 b) %False Position Mehtod clear all clc x0 = 0; %initial Guess xf=4; % Final Guess error = 1;
Background image of page 6
i=0 while (error > (5*10^(-7))) i=i+1 f0 = x0^2*abs(sin(x0))-4;
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ff = xf^2*abs(sin(xf))-4; if (f0*ff<0) x2 = x0-f0*(xf-x0)/(ff-f0); %Secant Part end f_x2 = x2^2*abs(sin(x2))-4 if (f0*f_x2<0) xf=x2; end if (f_x2*ff<0) x0=x2; end error = abs(f_x2); end...
View Full Document

This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

Page1 / 7

HW 4 Solution - ff = xf^2*abs(sin(xf))-4; if...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online