i want write the next function by matlab ?
1 回表示 (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/159178/image.jpeg)
2 件のコメント
John D'Errico
2016 年 12 月 22 日
It is time for you to learn to use loops. Here a for loop is simple and reasonable.
回答 (1 件)
Walter Roberson
2016 年 12 月 22 日
You syms Z but what is z (lower-case) ? Is it a function or is it a vector?
It is not possible to use a symbolic expression to index an array. If you have a finite vector to sum symbolically, then construct all elements of the vector and then sum() them. Constructing the elements of the vector is sometimes possible using vectorization.
t = 4:n;
L = sum((z(t) - null1 .* z(t-1) - null2 .* z(t-2) + theta .* alpha(t-1)).^2) ./ (2 .* sigma.^2);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!