使用MATLAB划分两个多项式

izz*_*zat 2 matlab

我希望除p(x)以下q(x):

p(x)=-5x^4+3x^2-6x
q(x)=x^2+1
Run Code Online (Sandbox Code Playgroud)

我试过了:

p=inline('-5*(x^4)+3*(x^2)','x')

p =
     Inline function:
     p(x) = -5*(x^4)+3*(x^2)

q=inline('x^2+1','x')

q =
     Inline function:
     q(x) = x^2+1

deconv(p,q)
Run Code Online (Sandbox Code Playgroud)

但得到了错误:

??? Undefined function or method 'filter' for input arguments of type 'inline'.

Error in ==> deconv at 32
   [q,zf] = filter(b, a, [1 zeros(1,nb-na)]);
Run Code Online (Sandbox Code Playgroud)

为什么?

Nzb*_*buu 15

内联函数只是它将评估的matlab表达式.它不知道它们是否是多项式.

你要这个:

p = [-5 0 3 -6 0];
q = [2 0 1];

[quotient remainder] = deconv(p, q)
Run Code Online (Sandbox Code Playgroud)

这里不需要符号数学工具箱.