Azzera filtri
Azzera filtri

How to fit data to a function with last output as input?

2 visualizzazioni (ultimi 30 giorni)
Hey, whats the easiest way to estimate the constants k1,k2,k3 in the function y:
y_n = k1 * x_n + k2 * x_(n-1) + k3 * y_(n-1)
I have an array of x and the desired y. I took a look at the optimization toolbox, but I dont know how to get it to work with last output/input as input.
Thanks for any suggestions!

Risposta accettata

Torsten
Torsten il 29 Lug 2016
A=zeros(N-1,3);
b=zeros(N-1);
A(:,1)=x(2:N);
A(:,2)=x(1:N-1);
A(:,3)=y(1:N-1);
b(1:N-1)=y(2:N);
k=A\b;
Best wishes
Torsten.

Più risposte (0)

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by