function qdot=chain(q)
T = q(1);
theta = q(2);
y= q(3) ;
s=q(4) ;
Tdot = tan(theta);
thetadot = 1/T;
ydot = tan(theta);
sdot = sec(theta);
qdot= [Tdot;thetadot;ydot;sdot];
end
this the code i am getting frequent error could anyone please find where iam doing mistake.

 채택된 답변

KSSV
KSSV 2022년 9월 7일

0 개 추천

You should show how you are calling the function. Note that, this function takes only one input q which is a 1x2 array. It seems, you are giving more number of inputs.
q = [1 2] ;
qdot = chain(q)
qdot = 4×1
-2.1850 1.0000 -2.1850 -2.4030
function qdot=chain(q)
T = q(1); theta = q(2);
Tdot = tan(theta);
thetadot = 1/T;
ydot = tan(theta);
sdot = sec(theta);
qdot= [Tdot;thetadot;ydot;sdot];
end

댓글 수: 5

Mohammed sohaib
Mohammed sohaib 2022년 9월 7일
Thanks for the reply Sorry even after changing I am getting the same .
Mohammed sohaib
Mohammed sohaib 2022년 9월 7일
I have edited it could you please see it once again Thanks.
KSSV
KSSV 2022년 9월 7일
Show us your full code....
Mohammed sohaib
Mohammed sohaib 2022년 9월 7일
Thanks for giving me the hint i have found where the problem is .
Mohammed sohaib
Mohammed sohaib 2022년 9월 7일
the problem was on the input side i have put too many input arguments.

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

추가 답변 (0개)

카테고리

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

태그

질문:

2022년 9월 7일

댓글:

2022년 9월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by