symbolic integer, Why doesn't it work?

1 次查看(过去 30 天)
I want to find the sum:
I tried finding with symbolic integer
syms n t
evalin(symengine,'assume(n,Type::Integer)');
symsum(exp(-k^2*t),k,1,n-1)
or
syms n t
evalin(symengine,'assume(n,Type::Integer)');
symsum(exp(-k*k*t),k,1,n-1)
I have got the next answer

回答(1 个)

Shubham Rawat
Shubham Rawat 2021-2-4
Hi Katalin,
You may try this:
syms k t
evalin(symengine,'assume(n,Type::Integer)');
n = 3; %taking input from workspace
symsum(exp(-k*k*t),k,1,n-1)
Result :
ans =
exp(-t) + exp(-4*t)
Hope this Helps!

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

产品


版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by