필터 지우기
필터 지우기

Attempt to extract field 'Bc' from 'double'_error.

조회 수: 14 (최근 30일)
chuyen hoangcao
chuyen hoangcao 2021년 4월 18일
댓글: chuyen hoangcao 2021년 4월 18일
I dont know why i have this error though the dimensions are true. Please help my code:
function Nc = fcn(qe, vr, wr, f,xe,ye)
Bc = [-1 0 0;ye -xe -1];
Bc1 = 5;
qeT = qe';
A = transpose(qeT.*Bc)*Bc1*norm(qe)*(f(1)*norm(vr)+f(2)*norm(wr)+f(3));
B=((norm(qeT.*Bc))^2+Bc1*(norm(Bc))^2);
Nc = -A/B;
Please help me. This error in line 5,6:
Size mismatch (size [1 x 3] ~= size [2 x 3]). Function 'Kinematic Controller/MATLAB Function' (#69.118.125), line 5, column 15: "qeT.*Bc"

답변 (1개)

Walter Roberson
Walter Roberson 2021년 4월 18일
qeT.Bc needs to have the period replaced by an operator such as qeT*Bc
  댓글 수: 2
chuyen hoangcao
chuyen hoangcao 2021년 4월 18일
Oh,thank you for responding to me.However, Im sorry because of my mistakes that I posted the question I fixed. I editted my question,please check for me. The qe's dimension I set is 3x1, and as you can see the Bc's dimension is 3x2.But when transpose(qe)*Bc ,they can not.
chuyen hoangcao
chuyen hoangcao 2021년 4월 18일
I know that .* is different from *, and my intent is *: matrix multiply,but the simulink error is not able to, it proposed me to convert to .*

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

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by