error in matrix dimension , this code use extended kalman filter for fusion radar and lidar sensor

댓글 수: 3

houssem alimi
houssem alimi 2019년 1월 4일
can someone help me ???
Bob Thompson
Bob Thompson 2019년 1월 4일
Can you post the entire error message please?
houssem alimi
houssem alimi 2019년 1월 4일
Error using *
Inner matrix dimensions must agree.
Error in extkflid (line 64)
X = X+ K*Y-(H_Lidar*X)

댓글을 달려면 로그인하십시오.

 채택된 답변

Bob Thompson
Bob Thompson 2019년 1월 4일

0 개 추천

I think that your issue is with K*Y. As best I can tell, K is 3x3, while Y is 2x2, so it is not possible to do matrix multiplication with two arrays of these sizes.

댓글 수: 6

houssem alimi
houssem alimi 2019년 1월 4일
so what can I do
K(:)*(Y(:)).' % this will stop the error but no idea if it will get you the desired result
Error using +
Matrix dimensions must agree.
Error in extkflid (line 64)
X = X+ K(:)*(Y(:)).'-(H_Lidar*X)
Bob Thompson
Bob Thompson 2019년 1월 4일
So X is 4x1, H_Lidar*X is 3x1, and K*Y is something. You're getting the error because the rules of matrix math won't allow this type of operation.
As for fixing it, the best I can offer is to make sure you have your equations correct, and that your matrices are the correct size. Unfortunately, I can't help much with that because I don't know what you're really trying to accomplish with this script.
houssem alimi
houssem alimi 2019년 1월 4일
for obtaining sensor fusion thanks to extended kalman filter
Bob Thompson
Bob Thompson 2019년 1월 4일
Yeah, I am unfamiliar with what that means.
Again, my suggestion is to go back and double check that the math and matrix sizes are what they should be based on hand calculations. If everything does compare with hand calculations, then I would suggest backing it out a bit further, and checking the original math.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

태그

질문:

2019년 1월 4일

댓글:

2019년 1월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by