Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Tony Yu
il 23 Giu 2020
Risposto: Walter Roberson
il 23 Giu 2020
is it because of the sin and cos? how do i solve this?
clc;
clear all;
a1 = 150; alpha1 = pi/2; d1 = 470;
a2 = 600; alpha2 = 0; d2 = 0;
a3 = 120; alpha3 = pi/2; d3 = 720;
syms c1 c2 c23 c3 c4 c5 c6 s1 c1 s2 s23 s3 s4 s5 s6 R03 R36 th1 th2 th3 th4 th5 th6 Xc Yc Zc R06 ox oz oy d6 r d D r11 r12 r13 r21 r22 r23 r31 r32 r33
c1 = cos(th1)
c2 = cos(th2)
c3 = cos(th3)
s1 = sin(th1)
s2 = sin(th2)
s3 = sin(th3)
c23 = cos(th2+th3)
s23 = sin(th2+th3)
d = a1
d6 = 5
%assume d6 = 5
R = [1 0 0 500;
0 1 0 100;
0 0 1 1500;
0 0 0 1];
r11 = R(1,1)
r12 = R(1,2)
r13 = R(1,3)
r21 = R(2,1)
r22 = R(2,2)
r23 = R(2,3)
r31 = R(3,1)
r32 = R(3,2)
r33 = R(3,3)
ox = R(1,4)
oy = R(2,4)
oz = R(3,4)
Xc = ox - d6*R(1,3)
Yc = oy - d6*R(2,3)
Zc = oz - d6*R(3,3)
D = (Xc^2+Yc^2-d^2+(Zc-d1)^2-a2^2-a3^2)/(2*a2*a3)
%inverse kinematic
th1 = atan2(Xc,Yc)
th2 = atan2(sqrt(Xc^2+Yc^2-d^2),Zc-d1)-atan2(a2+a3*c3*,a3*s3)
th3 = atan2 (D,sqrt((1-d^2)))
th4 = atan2(c1*c23*r13+s1*c23*r23+s23r33,-c1*s23*r13-s1*s23*r23+c23*r33)
th5 = atan2(s1*r13-c1*r23,sqrt(1-(s1*r13-c1*r23)^2))
th6 = atan2(-s1*r11+c1*r21, s1*r12-c1*r22)
Error: File: HW2_Q3.m Line: 44 Column: 55
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
0 Commenti
Risposta accettata
Walter Roberson
il 23 Giu 2020
In your line
th2 = atan2(sqrt(Xc^2+Yc^2-d^2),Zc-d1)-atan2(a2+a3*c3*,a3*s3)
^
you have a * without a following item to be multiplied by.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Numbers and Precision in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!