I got Error using vertcat Dimensions of arrays being concatenated are not consistent. Error in Code_tubes (line 22) C = [q(1); q(2); q(3);
Show older comments
I try to do compitational kinematic analysis, but when i write the driving constrain, this error occur, i dont have any idea about whats wrong in my line. Please somebody help me
%Input
d = 27.5; %cm
l2 = 31; %cm
l3 = 37; %cm
l4 = 38.5; %cm
w2 = 2; %rad/s
teta2_o = pi/2; %rad
t = 0:0.001:2;
Numdata = size(t,2);
%Matrix coordinate
q = zeros(12,1);
q_all = zeros(12,Numdata);
qdot_all = zeros(12,Numdata);
qdot2_all = zeros(12,Numdata);
uC = zeros(2,1);
rC_all = zeros(2,Numdata);
for j = 1:Numdata
for i = 1:3 %number of iteration
%Constrain matrix
C = [q(1); q(2); q(3);
q(4) - (l2*cos(q(6)))/2;
q(5) - (l2*sin(q(6)))/2;
q(4) + (l2*cos(q(6)))/2 - q(7) + (l3*cos(q(9)))/2;
q(5) + (l2*sin(q(6)))/2 - q(8) + (l3*sin(q(9)))/2;
q(7) - q(10) + (l4*cos(q(12)))/2;
q(8) - q(11) + (l4*sin(q(12)))/2;
q(10) + (l4*cos(q(12)))/2 - d;
q(11) + (l4*sin(q(12)))/2;
q(6) - teta2_o - w2*t];
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!