Error: File: puma560.m Line: 12 Column: 56 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2 次查看(过去 30 天)
clear all
clc
syms theta1 theta2 theta3 theta4 theta5 theta6;
theta1=0.12;
theta2=0.24;
theta3=0;
theta4=0;
theta5=0;
theta6=0;
T1=[cos(theta1) -sin(theta1) 0 0;sin(theta1) cos(theta1)
0 0;0 0 0 1;0 0 0 1];
T2=[cos(theta2) -sin(theta2) 0 0;0 0 1 0;-sin(theta2) -
cos(theta2) 0 0;0 0 0 1];
T3=[cos(theta3) -sin(theta3) 0 0.43180;sin(theta3)
cos(theta3) 0 0;0 0 1 0.12446;0 0 0 1];
T4=[cos(theta4) -sin(theta4) 0 0.02032;0 0 1 0.43180;-
sin(theta4) -cos(theta4)0 0;0 0 0 1];
T5=[cos(theta5) -sin(theta5) 0 0;0 0 -1 0;sin(theta5)
cos(theta5) 0 0;0 0 0 1];

回答(2 个)

Amir RF
Amir RF 2020-12-10
In T1, T2, T3, and T4 you made a typo. If you want to continue the vector, equation,... you should use "..." at the end of each line. Also, for T4, you have to put an space between "-cos(theta4)" and "0".
T1=[cos(theta1) -sin(theta1) 0 0;sin(theta1) cos(theta1) ...
0 0;0 0 0 1;0 0 0 1];
T2=[cos(theta2) -sin(theta2) 0 0;0 0 1 0;-sin(theta2) - ...
cos(theta2) 0 0;0 0 0 1];
T3=[cos(theta3) -sin(theta3) 0 0.43180;sin(theta3) ...
cos(theta3) 0 0;0 0 1 0.12446;0 0 0 1];
T4=[cos(theta4) -sin(theta4) 0 0.02032;0 0 1 0.43180; ...
-sin(theta4) -cos(theta4) 0 0;0 0 0 1];
Best,
  7 个评论
Rik
Rik 2020-12-10
Why don't you try using what Amir has showed you? This is basic Matlab syntax that will often need to use. Why don't you try learning from it, rather than waiting for someone else to make the edits for you?

请先登录,再进行评论。


balakrishna Gudapati
  3 个评论
Rik
Rik 2020-12-10
Have a read here and here. It will greatly improve your chances of getting an answer. You can find guidelines for posting homework on this forum here. If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). If your main issue is with understanding the underlying concept, you may consider re-reading the material you teacher provided and ask them for further clarification.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by