Question
Need these done on matlab

4. (10%) Given the roots (.--2, x-3.x-8), reconstruct the corresponding polynomial 5. (10%) Add the following polynomials: f(x)- x3-x +3 g(x) x2-8 h(x)-x*+2 6. (10%) Multiply the polynomials from Problem 5.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

4.CODE:

clear all;close all;clc;
r=[-2,3,8];
x= sym('x');
poly_eqn=expand(prod(x-r))

OUTPUT:

poly_eqn =

x^3 - 9*x^2 + 2*x + 48

5. CODE:

clear all;close all;clc;
% write equations as standard matlab vectors...
%adjust their coefficient arrays putting zeros for absent powers, so that
% coefficients of terms with the same power will be on the same positions within both coefficient arrays.
eq1=[0 1 0 -1 3];
eq2=[0 0 1 0 -8];
eq3=[1 0 0 0 2];
added_coeff=eq1+eq2+eq3;
%to get back the equation from coefficient....
added_eq = poly2sym(added_coeff)

OUTPUT:

added_eq =

x^4 + x^3 + x^2 - x - 3

6. CODE:

clear all;close all;clc;
eq1=[0 1 0 -1 3];
eq2=[0 0 1 0 -8];
eq3=[1 0 0 0 2];
r1=conv(eq1,eq2);
prod_coeff=conv(r1,eq3);
multiplied_eq = poly2sym(prod_coeff)

OUTPUT:

multiplied_eq =

x^9 - 9*x^7 + 3*x^6 + 10*x^5 - 24*x^4 - 18*x^3 + 6*x^2 + 16*x - 48

Add a comment
Know the answer?
Add Answer to:
Need these done on matlab 4. (10%) Given the roots (.--2, x-3.x-8), reconstruct the corresponding polynomial...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT