0% found this document useful (0 votes)
22 views

Assignment No.3: 1.12 Exercises

The document discusses using MATLAB to work with polynomials. It includes examples of using MATLAB to find the roots of polynomials, derive polynomials given their roots, and evaluate polynomials at given values. Specifically, it shows finding the roots of polynomials x^3+8x^2+10x+4 and y^5+7y^4+19y^3+25y^2+16y+4, deriving the polynomials with roots [-6.5708 -0.7146+0.3132i -0.7146-0.3132i] and [-2 -2 -3 -3 -3], and evaluating the polynomials x^3+8x^2+10x+4
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Assignment No.3: 1.12 Exercises

The document discusses using MATLAB to work with polynomials. It includes examples of using MATLAB to find the roots of polynomials, derive polynomials given their roots, and evaluate polynomials at given values. Specifically, it shows finding the roots of polynomials x^3+8x^2+10x+4 and y^5+7y^4+19y^3+25y^2+16y+4, deriving the polynomials with roots [-6.5708 -0.7146+0.3132i -0.7146-0.3132i] and [-2 -2 -3 -3 -3], and evaluating the polynomials x^3+8x^2+10x+4
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Assignment No.

3
1.12 Exercises
QUESTION:1
Use MATLAB to compute the roots of the following polynomials:
(a)
p(x)=x.^3+8*x.^2+10*x+4
p=[1 8 10 4]
p=

10

roots_p= roots(p)% find the roots of p(x)


roots_p =
-6.5708
-0.7146 + 0.3132i
-0.7146 - 0.3132i
(b)
p(y)=y.^5+7*y.^4+19*y.^3+25*y.^2+16*y+4
p=[1 7 19 25 16 4]
p=
1

19

25

16

roots_p=roots(p)% find the roots of p(y)


roots_p =
-2.0000
-2.0000
-1.0000
-1.0000 + 0.0000i
-1.0000 - 0.0000i
QUESTION:2
Use MATLAB to derive the polynomials having the following roots:
r1=[-6.5708 -0.7146+0.3132j -0.7146-0.3132j]

r1 =
-6.5708

-0.7146 + 0.3132i -0.7146 - 0.3132i

poly_r1=poly(r1)
poly_r1 =
1.0000 8.0000 9.9997
P(x)=x^3+8x^2+10x+4

4.0000

r2=[-2 -2 -3 -3 -3]
r2 =
-2 -2

-3

-3

-3

poly_r2=poly(r2)
poly_r2 =
1 13 67 171 216 108
P(x)=x^5+13x^4+67x^3+171x^2+216x+108
QUESTION:3
Use MATLAB to evaluate the polynomials below at the specified values:
(a)
p(x)=x.^3+8*x.^2+10*x+4
p=[1 8 10 4]
p=
1

10

value=polyval(p,1.25)
value =
30.9531
(b)
p(y)=y.^5+7*y.^4+19*y.^3+25*y.^2+16*y+4
p=[1 7 19 25 16 4]

p=
1

19

25

16

value=polyval(p,-3.75)
value =
-63.6904
Exercises

1THE END

You might also like