Please help me with this sequence equation

1 回表示 (過去 30 日間)
arsalan mehrabi
arsalan mehrabi 2020 年 12 月 19 日
コメント済み: Alan Stevens 2020 年 12 月 19 日
Hi I want to solve a sequence equation:
t(i)^(n+1)=e(t(i-1)^n+t(i+1)^n)
for i=2:1:5 and n=1:1:10 and n is not power.
so I wrote this:
for n = 1 :1: 10
for i = 2 :1: 5
t(1,i)=100
t(n+1,i) = 0.46875*t(n,i-1) + 0.0625t(n,i) + 0.46875(n,i+1);
end
end
What is the problem?
  2 件のコメント
Image Analyst
Image Analyst 2020 年 12 月 19 日
編集済み: Image Analyst 2020 年 12 月 19 日
Is e in that equation exp()? Like 2.718281828? So you want e to the power "(t(i-1)^n+t(i+1)^n)"?
And what's up with the third term? 0.46875 is a scalar and cannot have matrix indexes.
arsalan mehrabi
arsalan mehrabi 2020 年 12 月 19 日
yes

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

回答 (1 件)

Alan Stevens
Alan Stevens 2020 年 12 月 19 日
編集済み: Alan Stevens 2020 年 12 月 19 日
Firstly
t(n+1,i) = 0.46875*t(n,i-1)+0.0625t(n,i)+0.46875(n,i+1);
should probably be
t(n+1,i) = 0.46875*t(n,i-1)+0.0625*t(n,i)+0.46875*t(n,i+1);
Secondly, you want to use t(n,i+1), before you've determined it. (When n = 1, t(2,3) doesn't yet exist so you can't calculate t(2,2)).
  2 件のコメント
arsalan mehrabi
arsalan mehrabi 2020 年 12 月 19 日
編集済み: arsalan mehrabi 2020 年 12 月 19 日
so how can i do that ?
Alan Stevens
Alan Stevens 2020 年 12 月 19 日
I don't know! Looks like you need more initial information.

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

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by