Obtaining result from a previous point

1 回表示 (過去 30 日間)
Tino
Tino 2020 年 1 月 10 日
コメント済み: Tino 2020 年 1 月 31 日
Hello please can anyone help me to calculate the following
I have a result which give M which give a row of numbers
I want to calculate the formular
H{j} = (1 - 0.5) * H{j-1} + (0.5 * M)
assuming the first H{0} = 0
j = 0,1,2,3,4,5,6 and M = 0.3 ,0.2, 0.4, 0.5, 0.6, 0.8
how do i write the code
Your help will be greatly appreciated

採用された回答

M
M 2020 年 1 月 10 日
編集済み: M 2020 年 1 月 10 日
Have a look here:
You can write something like:
n= 7;
H = zeros(n,1);
for j = 2 : n
H(j) = 0.5*H(j-1) + 0.5*M(j)
end
  1 件のコメント
Tino
Tino 2020 年 1 月 31 日
Thank you

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2019a

Translated by