See a short video Please complete the code..

The above link is the video.
%%project #2a (sample)
clear all
clc
close all
%%input data
l1=10; % Length of link#1
l2=12; % link#2
l3=8; % link#3
w1=3; % width of link#1
w2=w1/2; % link#2
w3=w1/3; % link#3
w4=w1; % link#4
ex=w1/4; % extension
% link #1
x1=[w1/2 -w1/2 -w1/2-ex -w1/2-ex w1/2+ex w1/2+ex w1/2,...
w1/2 -w1/2 -w1/2 0]';
y1=[0 0 0 0 0 0 0 0 0 0 0]';
z1=[ex ex ex 0 0 ex ex l1+2*ex l1+2*ex ex l1]';
coord1=[x1,y1,z1,ones(size(x1))];
% link #2
% link#3
% link#4
figure('DoubleBuffer','on')
grid on
% view([59,36]);
% axis equal
axis([0 l2+l3+5, 0 l2+l3+5, 0 l2+l3+5])
xlabel('x-axis')
ylabel('y-axis')
zlabel('z-axis')
hold on
numsteps=40;
xdisp=10;
ydisp=10;
Tx=[0:xdisp/numsteps:xdisp , zeros(1,numsteps+1)+xdisp];
Ty=[zeros(1,numsteps+1), 0:ydisp/numsteps:ydisp ];
Tz=[zeros(1,numsteps+1), zeros(1,numsteps+1) ];
theta10=0;
theta20=pi/6;
theta30=-pi/3;
theta40=0;
theta4s=theta30;
maxtheta1=pi/6;
% Translation
for i=1:size(Tx,2)
tx=Tx(i);ty=Ty(i);tz=Tz(i);
tcoord1=link01(coord1,tx,ty,tz,theta10);
txb=tcoord1(11,1);
tyb=tcoord1(11,2);
tzb=tcoord1(11,3);
tobj11=line(tcoord1(1:10,1),tcoord1(1:10,2),tcoord1(1:10,3),'color','b','linewidth',2);
tobj12=plot3(txb,tyb,tzb,'o','color','r');
pause(0.05)
if i ~= size(Tx,2)
delete(tobj11, tobj12);
else
end
end
This code is not complete code .. Although I've given up trying for a week.
Please complete the code. Is the most important issues in my life.

Answers (1)

We try not to do your homework for you here, but to answer questions. You have not posed any question at all, but are pleading for someone to do your work. Not only that, but we are told to view a video to learn your task, then to read through and debug a piece of code with no comments, and no idea what is not working.
My answer is to drop the class if you cannot solve the problems. If that is not an option, then why have you not sat down with your instructor and asked them questions to help you resolve what you do not understand?

Categories

Asked:

Lee
on 5 May 2011

Community Treasure Hunt

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

Start Hunting!