I get Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. What does this mean? and how can I fix it?

4 views (last 30 days)
I don't understand what is going wrong with my code!! I would copy the code but it is very long! However, I get this error in the fourth line of the code below.
% Extended Kalman Filter
% EKF Cycle
Pstar=A*P*A'+F*Q*F';
% Estimate the state
[~,xest]=ode45('PlantModel',[t(k),t(k+1)],x(k,:)); % Estimation of states
x(k+1,:)=xest(end,:); % Assign a variable to the estimated states
% Correction
L=inv((C*Pstar*C'+R))*C*Pstar; % Update the value of the observer
P=(eye(3)-L'*C)*Pstar; % Update the Estimation Error
x(k+1,:)=(eye(3)-L'*C)*x(k+1,:)'+L'*y(k+1,:)'; % Update the States
  3 Comments
Walter Roberson
Walter Roberson on 4 Jan 2017
I would extend this and say that you are probably trying to take the inverse of an all-zero matrix or perhaps an empty matrix
Jan
Jan on 3 Apr 2019
[MOVED from flags] rui gao wrote:
Useful
@rui gao: Please use flags only to inform admins and editors about inappropriate contents like spam or rudeness. Thanks.

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!