using forecast in combination with nlarx gives an error

1 visualización (últimos 30 días)
Leon
Leon el 22 de Abr. de 2021
Respondida: Stefanie Schwarz el 27 de Abr. de 2021
When I try to use the forecast function in combination with a nlarx I get the following error: Unable to use a value of type idnlarx as an index
When I train the model and use the compare function everything works fine with no error message.
I am using the following code:
z = iddata(y_output, x_input, 1);
sys1 = nlarx(z(1:300),[15 15 1]);
forecast = 6;
figure(); compare(z(1:800), sys1, forecast);
Y_Pred = forecast(sys1, z(1:500), 6, z.u(501:506));
%forecast(sys,past_data,K,future_inputs);
Can anyone help?
Thx in advance. Best regards

Respuesta aceptada

Stefanie Schwarz
Stefanie Schwarz el 27 de Abr. de 2021
The error message is caused by the variable "forecast=6" in your code that shadows the "forecast" function. Please rename the variable to something else.
For more info, see also:

Más respuestas (0)

Categorías

Más información sobre Nonlinear Model Identification en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by