Filter löschen
Filter löschen

i want write the next function by matlab ?

1 Ansicht (letzte 30 Tage)
mohammed elmenshawy
mohammed elmenshawy am 22 Dez. 2016
Beantwortet: Walter Roberson am 22 Dez. 2016
  2 Kommentare
John D'Errico
John D'Errico am 22 Dez. 2016
It is time for you to learn to use loops. Here a for loop is simple and reasonable.
mohammed elmenshawy
mohammed elmenshawy am 22 Dez. 2016
i write the following and displayed the error
. what to do ?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 22 Dez. 2016
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);

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by