Professional Documents
Culture Documents
28 February 2017
r=
failure
n=
20
r=
failure
n=
20
% (b) using g2(x)
clc; close all; clear;
syms x
g2=inline('(0.3*x^2-1.4)^3');
ezplot(x)
hold on
ezplot (g2)
set(gca,'FontName','Courier New','FontSize',8)
xlabel('x')
ylabel('y')
title('Location of Fixed Point of g2(x)')
grid on
legend('y=x','g2(x)')
[r n]=FixedPoint(g2,-4)
[r n]=FixedPoint(g2,4)
r=
failure
n=
20
r=
failure
n=
20
NRoots =
-3.7837
-2.2163
0.2163
1.7837
x=
5.2500
7.8571
9.4405
10.2814
10.5314
hand written and matlab solutions are the same