Matlab multiplication of polynomials with syms

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 8K views
Ngineer
Messages
62
Reaction score
1
Is there anyway around this problem?

syms m,n;
x1 = [0, 1, 4, m];
x2 = [3, n, 9, 27];
conv(x1,x2)
Undefined function 'conv2' for input arguments of type 'sym'
 
Physics news on Phys.org
The conv and conv2 functions do not accept symbolic inputs.

I recommend you just generate each symbolic polynomial and then multiply. I don't have MATLAB here but I think it would be something like this:

syms m,n;
x1 = x^2+4x-m;
x2 = 3x^3+nx^2+9x+27;
expand(x1*x2)

http://www.mathworks.com/help/symbolic/expand.html