Hi everyone, I have a problem in my code
I'm trying to do an assignement between two array of dimension 3x1, but matlab told me everytime that it's impossible to do the operation because the size of the left term is 3-by-1 and the size of the right term is 3-by-0.. but during a debugging operation, I've controlled my right-side term and it is an array of 3x1.
basically, I have a function called EKF that picks as one of the input an array currentPose that is [1; 2; 3];
(in the main code, i give to the function the currentPose{1,1} that is effectively an array 3x1)
then inside this function it works like this:
EKF_p = zeros(3,2);
EKF_p(:,1) = currentPose;
EKF_p(:,2) = EKF_p(:,1) + dt*[cos(EKF_p(3,1)); sin(EKF_p(3,1)); omega];
and I get the error during this assignement.
Do anyone knows what the problem could be?
Thanks in advance

댓글 수: 1

Jan
Jan 2022년 4월 20일
Please post some code, which reproduces the problem and a copy of the complete error message.
The show code looks fine, so I expect, the problem is somewhere else, where you do not expect it.

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

 채택된 답변

Jan
Jan 2022년 4월 20일
편집: Jan 2022년 4월 20일

0 개 추천

Let the debugger help you to analyse the problem. Type this in the command window:
dbstop if error
Then let the code run again. When it stops at the error, check the sizes of the right hand side again.

댓글 수: 1

Cinzia Maestranzi
Cinzia Maestranzi 2022년 4월 20일
thank you so much for the answer! I didn't know this command!
The error was on another variable I was using during the operation
So thank you again and have a nice day

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Software Development Tools에 대해 자세히 알아보기

질문:

2022년 4월 20일

댓글:

2022년 4월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by