Assignment has more non-singleton rhs dimensions than non-singleton subscripts in UKF
Mostrar comentarios más antiguos
I'm trying to apply the unscented kalman filter as elaborated in the Artigo , to perform the estimation of the lambdah parameter of a time series. When implementing the code I get the following error
The commands in line 62 are hXi (:, k) = h (fXi (:, k)); and the error message i
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Error in Parametro_UKF (line 62) hXi(:,k) = h(fXi(:,k)); %h(Xi)
Hence I do not know how to do it because my measurement function only has three inputs of the five, that is, I only have the series of three variables. How to proceed, I'm trying to calculate the prediction of the measure through function h and Sigma Fxi points. I know there has to be dimensions, but I can not fathom how to correct.
It follows the implanted codes for the accomplishment of the parameter estimation.
I appreciate any help! If you notice any more errors please let me know, I do not know how to program very well!
6 comentarios
Walter Roberson
el 19 de Sept. de 2018
Error using load
Unable to read file 'dados.mat'. No such file or directory.
Error in Parametro_UKF (line 4)
load('dados.mat')
GTA
el 19 de Sept. de 2018
Walter Roberson
el 19 de Sept. de 2018
You have
h=@(x)[x(1) 0 0 0 0 0; % measurement equation
0 x(2) 0 0 0 0;
0 0 x(3) 0 0 0];
which creates a 3 x 6 matrix from the input vector.
You have
hXi = zeros(m, 2*n+1);
for k = 1:2*n+1
hXi(:,k) = h(fXi(:,k)); %h(Xi)
end
The right side produces a 3 x 6 matrix, but the left side describes a column vector. You cannot store a 3 x 6 matrix into a column vector.
We can tell from the way you initialized hXi that you are expecting h to output a 3 x 1 array, but you have clearly coded it to return a larger size.
GTA
el 19 de Sept. de 2018
Walter Roberson
el 19 de Sept. de 2018
Out of those 18 values, which 3 would you like to store in hXi(:,k) ?
GTA
el 19 de Sept. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!