I think that there is a small error in the sample solution of the kalman_estimate function.
The matrix A is calculated in the sample solution in the following way:
Code: Alles auswählen
A = (X(2:end, :)' * X(1:end-1,:)) / (X(1:end,:)' * X(1:end,:));
Code: Alles auswählen
A = (X(2:end, :)' * X(1:end-1,:)) / (X(1:end-1,:)' * X(1:end-1,:));
Best regards,
Andre