你好同学,代码供参考,考虑的是符号与多项式转换:
syms x a f = x^3 + 3*x^2 - 6*x + 5; p = sym2poly(f) %多项式系数 subs(f,x,5) subs(f,x,a)
运行结果:
p = 1 3 -6 5 ans = 175 ans = a^3 + 3*a^2 - 6*a + 5