multiplying polynomials with conv

14 visualizaciones (últimos 30 días)
Morley
Morley el 24 de Oct. de 2011
Editada: Walter Roberson el 2 de Jun. de 2015
use matlab to carry out the following multiplication of polynomials
(x+1.4)(x-0.4)x(x+0.6)(x-1.4)
heres what i did---
a = [1,1.4];
b = [1, -.4];
c = [1, 0];
d = [1, .6];
e = [1, -1.4];
p = conv(a, conv(b, conv(c, conv(d, e))))
it gave me the correct result but its tagging an extra zero onto the end of my result. i assume this means its coming out as one higher power then it is supposed to be with a "0" constant. anyone see any problems here?
my answer is supposed to come out as
p = [1, 0.2, -2.2, -3.92, .4704]
while my work is giving me
p = [1, 0.2, -2.2, -3.92, .4704, 0]
so somewhere it is giving me an extra power of x and im not sure why
  1 comentario
Valeriy Fedorikhin
Valeriy Fedorikhin el 2 de Jun. de 2015
Your answer is correct. There is a typo in the book - don't worry about it.

Iniciar sesión para comentar.

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 24 de Oct. de 2011
That is because you have one term as x, right? So the result will not have the constant term, as you specify [1,0] for x.
  3 comentarios
Fangjun Jiang
Fangjun Jiang el 24 de Oct. de 2011
No! The p given by conv() is correct. Double check your formula. The x in the middle, do you mean x or *?
Morley
Morley el 24 de Oct. de 2011
yes that is just an x
ok maybe my answer is coming out correct
now i need to plot

Iniciar sesión para comentar.

Categorías

Más información sobre Polynomials en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by