while running the below code i am facing an error that -- File: Snake.m Line: 36 Column: 21 Unbalanced or unexpected parenthesis or bracket.--please help me in this
Mostrar comentarios más antiguos
m = 1;%mass of one link in kg
l = 0.1;%half length of a link in m
J = m*l*l/3;%moment of inertia in kgm^2
ml2 = m*l*l;%defined for convenience - physical significance
N = 5;%number of links
ct = 0;%coefficient of viscosity along link
cn = 3.65;%coefficient of viscosity normal to link
% a=[0 0 0 0;0 0 0 0]
A = get_addmat(N);%adddition matrix
D = get_diffmat(N);%difference matrix
e = ones(N,1);
E = [e zeros(N,1);zeros(N,1) e];
K = A'/(D*D')*D;
V = (A'/(D*D'))*A;
theta = zeros(N,1);%link angles
theta_dot = zeros(N,1);%link angles
p = [0.5*N*l;0];%position of cg in global frame
p_dot = [0;0];%velocity of cg in global frame
del_t= 0.05;%time step size
X = -l*K'*cos(theta)+e*p(1);
Y = -l*K'*sin(theta)+e*p(2);
a=[1 2 3 4;0 0 0 0];
daspect([1 1 1]);
lh1 = line(X-l*cos(theta),Y-l*sin(theta));
lh2 = line(X+l*cos(theta),Y+l*sin(theta));
hold on;
lh3 = plot(X(1:N-1),Y(1:N-1),'o');s
for j=1:4
waypoints = a(:;j);
plot(waypoints(1), waypoints(2), 'r+');
hold off;
t = 0;
end
2 comentarios
Stephen23
el 10 de Mzo. de 2018
@ABHIJITH V NAIR: please show us the complete error message. This means all of the red text.
ABHIJITH V NAIR
el 10 de Mzo. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!