Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
wkm42
wkm42 el 29 de Jul. de 2016
Respondida: Torsten el 29 de Jul. de 2016
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!

Respuesta aceptada

Torsten
Torsten el 29 de Jul. de 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.

Más respuestas (0)

Categorías

Más información sobre Surrogate Optimization en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by