2 views (last 30 days)

syms x y z theta; a=90; b=122; t=50; v=[x y theta];

L1=sqrt(((-a/2*cosd(theta)-((b+t)*sind(theta))+x+1000).^2)+(-a/2*sind(theta)+(b+t)*cosd(theta)+y-1072).^2); Lx=diff(L1,x) Ly=diff(L1,y) Ltheta=diff(L1,theta)

L2=sqrt(((a/2*cosd(theta)-(b+t)*sind(theta)+x-1000).^2)+(a/2*sind(theta)+(b+t)*cosd(theta)+y-1072.)^2); Lx2=diff(L2,x) Ly2=diff(L2,y) Ltheta2=diff(L2,theta)

L3=sqrt(((b+t)*sind(theta)-x).^2+((1072-(b+t)*cosd(theta)-y).^2)+(1100+a/2).^2); Lx3=diff(L3,x) Ly3=diff(L3,y) Ltheta3=diff(L3,theta)

x=(-20:0.5:20); y=(-40:40); theta=(-40:40);

J=[Lx Ly Ltheta;Lx2 Ly2 Ltheta2;Lx2 Ly2 Ltheta3] J=det(A)

%the error is 함수 'cosd'은(는) 'sym'형 입력 인수에 대해 정의되지 않았습니다. function 'cosd' is not defined as inputted factor 'syms'

Siyu Guo
on 6 May 2018

Star Strider
on 6 May 2018

Put it just after the initial syms call, and use sym for the other numeric constants as well.

It would be appropriate for you to Accept Siyu Guo’s Answer.

Opportunities for recent engineering grads.

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

Start Hunting!
## 2 Comments

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/399334-use-diff-for-jacobian-but-there-is-a-problem#comment_564941

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/399334-use-diff-for-jacobian-but-there-is-a-problem#comment_564941

## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/399334-use-diff-for-jacobian-but-there-is-a-problem#comment_564956

⋮## Direct link to this comment

https://au.mathworks.com/matlabcentral/answers/399334-use-diff-for-jacobian-but-there-is-a-problem#comment_564956

Sign in to comment.