Formula Mean Values in Matlab code.
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, can anyone help to write in Matlab code the formula below. The third term with the minus sine is a double sum.
(sum from i=1 to N of Xt-i*168)/N + (sum from j=1 to 7 of Xt-j*24)/7 -(sum of i=1 to n sum of j=1 to 7 of Xt-i*168-j*24)/(7*N).
thank you for your time
4 件のコメント
回答 (1 件)
Image Analyst
2012 年 9 月 29 日
I don't think you've explained this correctly. What's the difference between t and i? Anyway, here's some code to get you started:
N = 100; % Or whatever. The number of elements.
T = 1 : N;
Xt = 2 * T; % Or whatever function of T that X is.
i = 1 : N;
theFirstSum = sum(Xt - (i * 168) / N)
5 件のコメント
Image Analyst
2012 年 9 月 30 日
To sum the prior 168 items, in general
theSum = zeros(1, lastIndex);
for k = 168 : lastIndex
theSum(k) = = sum(Xt((k - 167) : k));
end
参考
カテゴリ
Help Center および File Exchange で Time Series Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!