How to calculate sum of power series

3 ビュー (過去 30 日間)
DARREN O BRIEN
DARREN O BRIEN 2020 年 10 月 30 日
コメント済み: Ameer Hamza 2020 年 10 月 30 日
i cant get the code the work
im trying to write a(n+2)=(a(n+1)a(n+1)-b*a*n-2)/(n+2)(n+1)
but the variable a and b are tripping me up
and this error keep coming up
Error: Invalid expression. When calling a function or
indexing a variable, use parentheses. Otherwise, check
for mismatched delimiters.
n=5;
for i=1:n
p=(((a*n+1*a*n+1-b*a*n-2)/(n+2*n+1);
end
  1 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 10 月 30 日
It seems that the there are mistakes in expression
a(n+2)=(a(n+1)a(n+1)-b*a*n-2)/(n+2)(n+1)
can you show from where did you get this series? Is there a known name for this? Can you attach the original source for this series.

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

採用された回答

KSSV
KSSV 2020 年 10 月 30 日
編集済み: KSSV 2020 年 10 月 30 日
n=5;
a = rand ;
b = rand ;
p = 0 ;
for i=1:n
p=p+ (a*n+1*a*n+1-b*a*n-2)/(n+2*n+1); % check the expression though
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by