On the interval I51065106 we define the function fxln1xcosxx

On the interval I=[-5*10^-6,5*10^-6] we define the function f(x)=ln(1+x)-cosx-x+1
Plot this function in Matlab by evaluating it at 1001 equally distributed points in the interval I and perform all calculations in IEEE standard double precision.Explain the plot you obatined.
And reformulate the function f(x) to obtain a more accurate result and then repeat the first question.

Solution

%defining range
x = [-5*10^-6:0.1:5*10^-6]
y = log(1+x)-cos(x)-x+1
figure
plot(x,y)

On the interval I=[-5*10^-6,5*10^-6] we define the function f(x)=ln(1+x)-cosx-x+1 Plot this function in Matlab by evaluating it at 1001 equally distributed poin

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site