Info
此问题已关闭。 请重新打开它进行编辑或回答。
How to obtain values symbolically
3 次查看(过去 30 天)
显示 更早的评论
Hi! Im using Matlab version 7.9.0(R2009b) and i would like to sum e.g. first 10 terms of expression c_i*x^i, where c_i should be obtained symbolically. how should i do that, so that this expression is dependent on x / function of x (so when i enter exact number for x, i get real number - not expression with c_i).
0 个评论
回答(2 个)
Azzi Abdelmalek
2013-2-22
编辑:Azzi Abdelmalek
2013-2-22
EDIT
c=sym('c',[1 10])
x=sym('x')
f=@(x,n)sum(c(1:n).*x.^(1:n))
f(x,5)
8 个评论
Walter Roberson
2013-2-23
If that is the complete instruction you are given, then the c_i are just the symbolic variables, and you will not be able to complete the second part.
If there are instructions before that point, then you might be able to proceed further.
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!