symbolic integer, Why doesn't it work?

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 日

0 投票

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!

1 件のコメント

Katalin Kuchinka
Katalin Kuchinka 2021 年 2 月 8 日
Thanks. But, I want to create a function f(t,n).
I need to find

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

製品

リリース

R2020b

質問済み:

2021 年 2 月 1 日

コメント済み:

2021 年 2 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by