Professional Documents
Culture Documents
Lab 4 Solving Roots of Equations and Polynomials Using Packages and MATLAB
Lab 4 Solving Roots of Equations and Polynomials Using Packages and MATLAB
Lab 4 Solving Roots of Equations and Polynomials Using Packages and MATLAB
Examples 1;
1.) determine roots of f(x) = x cos x
f(x) = x cos x
U(x,y) = x2 + xy -10 = 0
V(x,y) = y + 3xy2 -57 = 0
initial values of x = 1 and y = 3.5
True value x = 2 and y = 3
Solution;
fzero(f,xo,options)
>>xo = [0 1.3];
>>x=fzero(inline(x^10-1),xo)
x=
-1
>>xo = 0;
>>x=fzero(inline(x^10-1),xo)
x=
-1
Use MATLAB to determine the roots of
polynomials
Example 2