how do i write a matlab script to sum this expression?
19 次查看(过去 30 天)
显示 更早的评论
采纳的回答
更多回答(1 个)
Stephan
2020-11-24
Symbolic:
syms n positive integer
N = 10000;
eq = 1/n + 1/((n+2)*(n+3));
pretty(eq)
sol = symsum(eq,n,1,N)
sol_num = double(sol)
results in:
>> Untitled
1 1
--------------- + -
(n + 2) (n + 3) n
sol =
eulergamma + psi(10001) + 10000/30009
sol_num =
10.1208
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
