Numerical methods using matlabyou dont have to solve 32 just

Numerical methods using matlab...you don\'t have to solve 3.2 just in matlab it is related to problem 3.16

Solution

clc
clear all
FUN=at the rate (x) x-2*exp(-x);%*****(you can use at the rate symbol there some problem here)
a=0;
b=1;
Xs=BisectionRoot(FUN,a,b)

function Xs=BisectionRoot(FUN,a,b)
eps=1e-6;
f=FUN;
if (f(a)<0 && f(b)>0)
err=inf;
z=a;
k=1;
while(err>eps && k<100)
c=(a+b)/2;
k=k+1;
if f(c)>0
b=c;
else a=c;
end
err=f(c)-f(z);
end
else
disp(\'Enter correct a, b values\')
end
Xs=c;

Xs =

0.8526

Numerical methods using matlab...you don\'t have to solve 3.2 just in matlab it is related to problem 3.16Solutionclc clear all FUN=at the rate (x) x-2*exp(-x);

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site