Matlab:多项式展开例程 [英] Matlab: Polynomial Expansion Routine

查看:142
本文介绍了Matlab:多项式展开例程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mathematica中, 这样的术语很容易扩展

In Mathematica, it's easy to expand terms like

(ax^2+bx+c)^n

但是无论如何我可以在Matlab中做到这一点吗?

But is there anyway I can do this in Matlab?

推荐答案

对于任何任意表达式:并非没有Symbolic Toolbox. http://www.mathworks.com/help/toolbox/symbolic/expand.html

For any arbitrary expression: not without the Symbolic Toolbox. http://www.mathworks.com/help/toolbox/symbolic/expand.html

但是,如果要扩展多项式,可以使用conv函数.只需循环运行即可.

However, if you wish to expand polynomials, you can use the conv function. Just run it in a loop.

a = 1;
b = 2;
c = 3;
n = 5;
soln = [a b c];
for i=1:n-1
   soln = conv(soln,[a b c]);
end 

这篇关于Matlab:多项式展开例程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆