我想将 p(x)
除以 q(x)
,因为:
p(x)=-5x^4+3x^2-6x
q(x)=x^2+1
我试过:
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)
但出现错误:
??? 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)]);
为什么?
最佳答案
内联函数只是它将计算的 matlab 表达式。它不知道它们是否是多项式。
你想要这个:
p = [-5 0 3 -6 0];
q = [2 0 1];
[quotient remainder] = deconv(p, q)
这里不需要 Symbolic Math Toolbox。
关于matlab - 使用 MATLAB 除以两个多项式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1726988/