Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %PROJECT 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %ROBOTICS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %BRANDON JACQUES.32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %David Ritz.32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %basic settup garbage
- clear;
- clc;
- min = [-5200 -400 0 -1200 -2400];
- max = [5200 4800 3600 1200 2400];
- curAn = [0 -400 3600 500 100];%HOME -> curAn = [0 3600 0 0 -1100];
- Home = [0 3600 0 0 -1100];
- Bi = 220;
- F = 160;
- W = 50;
- Cl = 75;
- p1a = [0; 0; 220; 1;];
- p2b = [0; 0; 160; 1;];
- p3c = [0; 0; 50; 1;];
- exit = 0;
- %Setting up figure
- Fig = gca;
- Fig.FontSize = 12;
- Fig.TickDir = 'out';
- Fig.TickLength = [.02, .02];
- Fig.XLimMode = 'manual';
- Fig.YLimMode = 'manual';
- Fig.YLim = [-100, 800];
- Fig.XLim = [-100, 800];
- %Calculating angles for sine/cosine inputs
- T1 = 90 - (curAn(1) * .025);
- T2 = (curAn(2)) * .025;
- T3 = (curAn(3)) * .025;
- T4 = (curAn(4)) * .075;
- T5 = (curAn(5)) * .075;
- %Distance between clamps from side view
- L=75;
- OP = sind(T5)*L;
- %Marking points
- p3c1 = [-1*(OP/2); 0; 50; 1;];
- p3c2 = [(OP/2); 0; 50; 1;];
- p3c1L = [-1*(OP/2); 0; 50+75; 1;];
- p3c2L = [(OP/2); 0; 50+75; 1;];
- %Transfer functions
- tran01 = [[cosd(T2) 0 sind(T2) 0];
- [0 1 0 0];
- [(-1*sind(T2)) 0 cosd(T2) 250];
- [0 0 0 1];];
- tran12 = [[cosd(T3) 0 sind(T3) 0];
- [0 1 0 0];
- [(-1*sind(T3)) 0 cosd(T3) 220];
- [0 0 0 1];];
- tran23 = [[cosd(T4) 0 sind(T4) 0];
- [0 1 0 0];
- [(-1*sind(T4)) 0 cosd(T4) 160];
- [0 0 0 1];];
- tran0A = [[cosd(T1) sind(T1) 0 0];
- [(-1*sind(T1)) cosd(T1) 0 0];
- [0 0 1 0];
- [0 0 0 1];];
- %setting up Tt_ in order to calculate the top view better. Tt_ is an angle
- if abs(T2) > 90
- Tt2 = 90 - mod(T2,90);
- else
- Tt2 = T2;
- end
- if abs(T2+T3) > 90
- Tt3 = 90 - mod(T2+T3,90);
- else
- Tt3 = T2+T3;
- end
- if abs(T2+T3+T4) > 90
- Tt4 = 90 - mod(T2+T3+T4,90);
- else
- Tt4 = T2+T3+T4;
- end
- Tt5 = T5;
- %Lengths of each segment from top view
- Bt = sind(Tt2) * Bi;
- Ft = sind(Tt3) * F;
- Wt = sind(Tt4) * W;
- Ct = sind(Tt4) * Cl;
- AP = cosd(Tt5) * L;
- %points in top view
- PAL = [0;Bt+Ft+Wt; 0;1;];
- PA1L=[0; Bt; 0; 1;];
- PA2L=[0; Ft; 0; 1;];
- PA3L=[0; Wt; 0; 1;];
- %Claw points in side view
- PAc1 = [-1*AP/2; Bt+Ft+Wt; 0; 1;];
- PAc2 = [AP/2; Bt+Ft+Wt; 0; 1;];
- PAc1L = [-1*AP/2; Bt+Ft+Wt+Ct; 0; 1;];
- PAc2L = [AP/2; Bt+Ft+Wt+Ct; 0; 1;];
- %Points in side view of all the arms in the 0 frame
- P0a = tran01*p1a;
- P0b = tran01*tran12*p2b;
- P0c = tran01*tran12*tran23*p3c;
- P0c1 = tran01*tran12*tran23*p3c1;
- P0c2 = tran01*tran12*tran23*p3c2;
- P0c1L = tran01*tran12*tran23*p3c1L;
- P0c2L = tran01*tran12*tran23*p3c2L;
- %top view points in 0 frame
- P0AL = tran0A*PAL;
- P0A1L = tran0A*PA1L;
- P0A2L = tran0A*PA2L;
- P0A3L = tran0A*PA3L;
- P0Ac1 = tran0A*PAc1;
- P0Ac2 = tran0A*PAc2;
- P0Ac1L = tran0A*PAc1L;
- P0Ac2L = tran0A*PAc2L;
- hold on
- %get rid of all previously drawn lines
- lines = get(gca, 'Children');
- delete(lines);
- %draw axis
- line([0 0],[0 75],'LineWidth',2.75);
- line([0 75],[0 0],'LineWidth',2.75);
- line([400 400],[0 75],'LineWidth',2.75);
- line([400 475],[0 0],'LineWidth',2.75);
- %draw side view
- line([0 0],[10 250]);
- line([0 P0a(1)],[250 P0a(3)]);
- line([P0a(1) P0b(1)],[P0a(3) P0b(3)]);
- line([P0b(1) P0c(1)],[P0b(3) P0c(3)]);
- line([P0c1(1) P0c2(1)],[P0c1(3) P0c2(3)]);
- line([P0c1(1) P0c1L(1)],[P0c1(3) P0c1L(3)]);
- line([P0c2(1) P0c2L(1)],[P0c2(3) P0c2L(3)]);
- %draw top view
- line([400 P0A1L(1)+400],[0 P0A1L(2)]);
- line([400+P0A1L(1) P0A2L(1)+P0A1L(1)+400],[P0A1L(2) P0A2L(2)+P0A1L(2)]);
- line([P0A2L(1)+P0A1L(1)+400 P0A3L(1)+P0A2L(1)+P0A1L(1)+400],[P0A2L(2)+P0A1L(2) P0A3L(2)+P0A2L(2)+P0A1L(2)]);
- line([P0Ac1(1)+400 P0Ac2(1)+400],[P0Ac1(2) P0Ac2(2)]);
- line([P0Ac1(1)+400 P0Ac1L(1)+400],[P0Ac1(2) P0Ac1L(2)]);
- line([P0Ac2(1)+400 P0Ac2L(1)+400],[P0Ac2(2) P0Ac2L(2)]);
- %name axis
- text(-30,70,'Z');
- text(70,-30,'X');
- text(370,70,'Y');
- text(470,-30,'X');
- hold off
- %main loop
- while exit == 0
- %grab all the input angles. it comes out as a vector if you input it
- %into the box correctly
- samp = inputdlg('Input spaceseperated numbers(waist shoulder elbow wrist1 wrist2) then ; at the end of every position. Type "home" to move to home position OR type spin for spin function','Sampled', [1 50]);
- s2='spin'; % might not need this
- tf2 = strncmpi(samp,'spin',4);
- if tf2 == 1
- % Initalize circle values
- Xs = 140;
- Ys = 0; %does not change
- Zs = 240;
- Rs = 60;
- %omega represents the current angle of the circle
- for omega = 0:360
- %%Calculate our X/Y/Z corridnates in mm
- X = Xs + Rs*sind(omega);
- Y = Ys + Rs*cosd(omega);
- Z = Zs; %Z remains constant
- %Calculate our theta values in degrees
- theta1=atand(Y/X);
- %dist is used to find thetas 2 and 3
- Dist=sqrt((X.^2)+2500);
- theta2=acosd(250/Dist)+acosd(((-22800-Dist.^2)/(-320*Dist)));
- theta3=acosd((Dist.^2-22800)/-70400);
- %Robot forms a kind of quadralateral, so last theta can be
- %determined using algebra
- theta4=360-90-theta2-theta3;
- %Draw the robot
- %It Goes Here
- end
- else
- HomeTest = samp{:};
- samp = str2num(samp{:});
- Size = size(samp);
- LENGTH = Size(1);
- %loop fro every line you inputed into the box with ; as the end line
- %setup for this run through the loop. set A-E to be the inputed
- %variables
- s1 = 'home';%matlab is fucking dumb
- tf = strcmp(HomeTest,s1)
- if tf == 1
- while ~isequal(curAn,Home)
- if curAn(1) < Home(1)
- curAn(1) = curAn(1) + 40;
- elseif curAn(1) > Home(1)
- curAn(1) = curAn(1) - 40;
- end
- if curAn(2) < Home(2)
- curAn(2) = curAn(2) + 40;
- elseif curAn(1) > Home(2)
- curAn(2) = curAn(2) - 40;
- end
- if curAn(3) < Home(3)
- curAn(3) = curAn(3) + 40;
- elseif curAn(3) > Home(3)
- curAn(3) = curAn(3) - 40;
- end
- if curAn(4) < Home(4) + 13.4 || curAn(4) > Home(4) - 13.4
- curAn(4) = Home(4);%We can't iterate anysmaller than this. So next move is to Home(4)
- elseif curAn(4) < Home(4)
- curAn(4) = curAn(4) + 13.33333;
- elseif curAn(4) > Home(4)
- curAn(4) = curAn(4) - 13.33333;
- end
- if curAn(5) < Home(5) + 13.4 || curAn(5) > Home(5) - 13.4
- curAn(5) = Home(5);%We can't iterate anysmaller than this. So next move is to Home(4)
- elseif curAn(5) < Home(5)
- curAn(5) = curAn(5) + 13.33333;
- elseif curAn(5) > Home(5)
- curAn(5) = curAn(5) - 13.33333;
- end
- %Setting up figure
- Fig = gca;
- Fig.FontSize = 12;
- Fig.TickDir = 'out';
- Fig.TickLength = [.02, .02];
- Fig.XLimMode = 'manual';
- Fig.YLimMode = 'manual';
- Fig.YLim = [-100, 800];
- Fig.XLim = [-100, 800];
- %Calculating angles for sine/cosine inputs
- T1 = 90 - (curAn(1) * .025);
- T2 = (curAn(2)) * .025;
- T3 = (curAn(3)) * .025;
- T4 = (curAn(4)) * .075;
- T5 = (curAn(5)) * .075;
- %Distance between clamps from side view
- OP = sind(T5)*L;
- %Marking points
- p3c1 = [-1*(OP/2); 0; 50; 1;];
- p3c2 = [(OP/2); 0; 50; 1;];
- p3c1L = [-1*(OP/2); 0; 50+75; 1;];
- p3c2L = [(OP/2); 0; 50+75; 1;];
- %Transfer functions
- tran01 = [[cosd(T2) 0 sind(T2) 0];
- [0 1 0 0];
- [(-1*sind(T2)) 0 cosd(T2) 250];
- [0 0 0 1];];
- tran12 = [[cosd(T3) 0 sind(T3) 0];
- [0 1 0 0];
- [(-1*sind(T3)) 0 cosd(T3) 220];
- [0 0 0 1];];
- tran23 = [[cosd(T4) 0 sind(T4) 0];
- [0 1 0 0];
- [(-1*sind(T4)) 0 cosd(T4) 160];
- [0 0 0 1];];
- tran0A = [[cosd(T1) sind(T1) 0 0];
- [(-1*sind(T1)) cosd(T1) 0 0];
- [0 0 1 0];
- [0 0 0 1];];
- %setting up Tt_ in order to calculate the top view better. Tt_ is an angle
- if abs(T2) > 90
- Tt2 = 90 - mod(T2,90);
- else
- Tt2 = T2;
- end
- if abs(T2+T3) > 90
- Tt3 = 90 - mod(T2+T3,90);
- else
- Tt3 = T2+T3;
- end
- if abs(T2+T3+T4) > 90
- Tt4 = 90 - mod(T2+T3+T4,90);
- else
- Tt4 = T2+T3+T4;
- end
- Tt5 = T5;
- %Lengths of each segment from top view
- Bt = sind(Tt2) * Bi;
- Ft = sind(Tt3) * F;
- Wt = sind(Tt4) * W;
- Ct = sind(Tt4) * Cl;
- AP = cosd(Tt5) * L;
- %points in top view
- PAL = [0;Bt+Ft+Wt; 0;1;];
- PA1L=[0; Bt; 0; 1;];
- PA2L=[0; Ft; 0; 1;];
- PA3L=[0; Wt; 0; 1;];
- %Claw points in side view
- PAc1 = [-1*AP/2; Bt+Ft+Wt; 0; 1;];
- PAc2 = [AP/2; Bt+Ft+Wt; 0; 1;];
- PAc1L = [-1*AP/2; Bt+Ft+Wt+Ct; 0; 1;];
- PAc2L = [AP/2; Bt+Ft+Wt+Ct; 0; 1;];
- %Points in side view of all the arms in the 0 frame
- P0a = tran01*p1a;
- P0b = tran01*tran12*p2b;
- P0c = tran01*tran12*tran23*p3c;
- P0c1 = tran01*tran12*tran23*p3c1;
- P0c2 = tran01*tran12*tran23*p3c2;
- P0c1L = tran01*tran12*tran23*p3c1L;
- P0c2L = tran01*tran12*tran23*p3c2L;
- %top view points in 0 frame
- P0AL = tran0A*PAL;
- P0A1L = tran0A*PA1L;
- P0A2L = tran0A*PA2L;
- P0A3L = tran0A*PA3L;
- P0Ac1 = tran0A*PAc1;
- P0Ac2 = tran0A*PAc2;
- P0Ac1L = tran0A*PAc1L;
- P0Ac2L = tran0A*PAc2L;
- hold on
- %get rid of all previously drawn lines
- lines = get(gca, 'Children');
- delete(lines);
- %draw axis
- line([0 0],[0 75],'LineWidth',2.75);
- line([0 75],[0 0],'LineWidth',2.75);
- line([400 400],[0 75],'LineWidth',2.75);
- line([400 475],[0 0],'LineWidth',2.75);
- %draw side view
- line([0 0],[10 250]);
- line([0 P0a(1)],[250 P0a(3)]);
- line([P0a(1) P0b(1)],[P0a(3) P0b(3)]);
- line([P0b(1) P0c(1)],[P0b(3) P0c(3)]);
- line([P0c1(1) P0c2(1)],[P0c1(3) P0c2(3)]);
- line([P0c1(1) P0c1L(1)],[P0c1(3) P0c1L(3)]);
- line([P0c2(1) P0c2L(1)],[P0c2(3) P0c2L(3)]);
- %draw top view
- line([400 P0A1L(1)+400],[0 P0A1L(2)]);
- line([400+P0A1L(1) P0A2L(1)+P0A1L(1)+400],[P0A1L(2) P0A2L(2)+P0A1L(2)]);
- line([P0A2L(1)+P0A1L(1)+400 P0A3L(1)+P0A2L(1)+P0A1L(1)+400],[P0A2L(2)+P0A1L(2) P0A3L(2)+P0A2L(2)+P0A1L(2)]);
- line([P0Ac1(1)+400 P0Ac2(1)+400],[P0Ac1(2) P0Ac2(2)]);
- line([P0Ac1(1)+400 P0Ac1L(1)+400],[P0Ac1(2) P0Ac1L(2)]);
- line([P0Ac2(1)+400 P0Ac2L(1)+400],[P0Ac2(2) P0Ac2L(2)]);
- %name axis
- text(-30,70,'Z');
- text(70,-30,'X');
- text(370,70,'Y');
- text(470,-30,'X');
- hold off
- %pause so everyone can see what changed on the frame
- pause(.01);
- end
- else
- for i = 1:LENGTH
- A = samp(i,1);%waist
- B = samp(i,2);%shoulder
- C = samp(i,3);%elbow
- D = samp(i,4);%wrist1
- E = samp(i,5);%wrist2
- while A ~= 0 || B ~= 0 || C ~= 0 || D ~= 0 || E ~= 0
- %Find if angle change A
- % is within limits
- if A > 0
- if curAn(1) + 40 < max(1)
- curAn(1) = curAn(1) + 40;
- if A < 40
- A = 0;
- else
- A = A - 40;
- end
- else
- curAn(1) = max(1);
- A = 0;
- end
- elseif A < 0
- if curAn(1) - 40 > min(1)
- curAn(1) = curAn(1) - 40;
- if A > -40
- A = 0;
- else
- A = A + 40;
- end
- else
- curAn(1) = min(1)
- A = 0;
- end
- end
- if B > 0
- if curAn(2) + 40 < max(2)
- curAn(2) = curAn(2) + 40;
- if B < 40
- B = 0;
- else
- B = B - 40;
- end
- else
- curAn(2) = max(2);
- B = 0;
- end
- elseif B < 0
- if curAn(2) - 40 > min(2)
- curAn(2) = curAn(2) - 40;
- if B > -40
- B = 0;
- else
- B = B + 40;
- end
- else
- curAn(2) = min(2);
- B = 0;
- end
- end
- if C > 0
- if curAn(3) + 40 < max(3)
- curAn(3) = curAn(3) + 40;
- if C < 40
- C = 0;
- else
- C = C - 40;
- end
- else
- curAn(3) = max(3);
- C = 0;
- end
- elseif C < 0
- if curAn(3) - 40 > min(3)
- curAn(3) = curAn(3) - 40;
- if C > -40
- C = 0;
- else
- C = C + 40;
- end
- else
- curAn(3) = min(3);
- C = 0;
- end
- end
- %Find out what kind of angle change D
- %and E are. Both the same sign means
- %wrist up/down and different signs
- %means wrist spin left/right
- %then check limits of angle 4/5
- if (D < 0 & E < 0) || (D*E > 0)
- if D > 0
- if curAn(5) + 13.33333 < max(5)
- curAn(5) = curAn(5) + 13.33333;
- if D < 13.4
- D = 0;
- E = 0;
- else
- D = D - 13.33333;
- E = E - 13.33333;
- end
- else
- curAn(5) = max(5);
- D = 0;
- E = 0;
- end
- elseif D < 0
- if curAn(5) - 13.33333 > min(5)
- curAn(5) = curAn(5) - 13.33333;
- if D > -13.4
- D = 0;
- E = 0;
- else
- D = D + 13.33333;
- E = E + 13.33333;
- end
- else
- curAn(5) = min(5);
- D = 0;
- E = 0;
- end
- end
- else
- if D-E > 0
- if curAn(4) + 13.33333 < max(4)
- curAn(4) = curAn(4) + 13.33333;
- if D-E < 13.4
- D = 0;
- E = 0;
- else
- D = D - 13.33333;
- E = E + 13.33333;
- end
- else
- curAn(4) = max(4);
- D = 0;
- E = 0;
- end
- elseif D-E < 0
- if curAn(4) - 13.33333 > min(4)
- curAn(4) = curAn(4) - 13.33333;
- if D-E > -13.4
- D = 0;
- E = 0;
- else
- D = D - 13.33333;
- E = E + 13.33333;
- end
- else
- curAn(4) = min(4);
- D = 0;
- E = 0;
- end
- end
- end
- %Setting up figure
- Fig = gca;
- Fig.FontSize = 12;
- Fig.TickDir = 'out';
- Fig.TickLength = [.02, .02];
- Fig.XLimMode = 'manual';
- Fig.YLimMode = 'manual';
- Fig.YLim = [-100, 800];
- Fig.XLim = [-100, 800];
- %Calculating angles for sine/cosine inputs
- T1 = 90 - (curAn(1) * .025);
- T2 = (curAn(2)) * .025;
- T3 = (curAn(3)) * .025;
- T4 = (curAn(4)) * .075;
- T5 = (curAn(5)) * .075;
- %Distance between clamps from side view
- OP = sind(T5)*L;
- %Marking points
- p3c1 = [-1*(OP/2); 0; 50; 1;];
- p3c2 = [(OP/2); 0; 50; 1;];
- p3c1L = [-1*(OP/2); 0; 50+75; 1;];
- p3c2L = [(OP/2); 0; 50+75; 1;];
- %Transfer functions
- tran01 = [[cosd(T2) 0 sind(T2) 0];
- [0 1 0 0];
- [(-1*sind(T2)) 0 cosd(T2) 250];
- [0 0 0 1];];
- tran12 = [[cosd(T3) 0 sind(T3) 0];
- [0 1 0 0];
- [(-1*sind(T3)) 0 cosd(T3) 220];
- [0 0 0 1];];
- tran23 = [[cosd(T4) 0 sind(T4) 0];
- [0 1 0 0];
- [(-1*sind(T4)) 0 cosd(T4) 160];
- [0 0 0 1];];
- tran0A = [[cosd(T1) sind(T1) 0 0];
- [(-1*sind(T1)) cosd(T1) 0 0];
- [0 0 1 0];
- [0 0 0 1];];
- %setting up Tt_ in order to calculate the top view better. Tt_ is an angle
- if abs(T2) > 90
- Tt2 = 90 - mod(T2,90);
- else
- Tt2 = T2;
- end
- if abs(T2+T3) > 90
- Tt3 = 90 - mod(T2+T3,90);
- else
- Tt3 = T2+T3;
- end
- if abs(T2+T3+T4) > 90
- Tt4 = 90 - mod(T2+T3+T4,90);
- else
- Tt4 = T2+T3+T4;
- end
- Tt5 = T5;
- %Lengths of each segment from top view
- Bt = sind(Tt2) * Bi;
- Ft = sind(Tt3) * F;
- Wt = sind(Tt4) * W;
- Ct = sind(Tt4) * Cl;
- AP = cosd(Tt5) * L;
- %points in top view
- PAL = [0;Bt+Ft+Wt; 0;1;];
- PA1L=[0; Bt; 0; 1;];
- PA2L=[0; Ft; 0; 1;];
- PA3L=[0; Wt; 0; 1;];
- %Claw points in side view
- PAc1 = [-1*AP/2; Bt+Ft+Wt; 0; 1;];
- PAc2 = [AP/2; Bt+Ft+Wt; 0; 1;];
- PAc1L = [-1*AP/2; Bt+Ft+Wt+Ct; 0; 1;];
- PAc2L = [AP/2; Bt+Ft+Wt+Ct; 0; 1;];
- %Points in side view of all the arms in the 0 frame
- P0a = tran01*p1a;
- P0b = tran01*tran12*p2b;
- P0c = tran01*tran12*tran23*p3c;
- P0c1 = tran01*tran12*tran23*p3c1;
- P0c2 = tran01*tran12*tran23*p3c2;
- P0c1L = tran01*tran12*tran23*p3c1L;
- P0c2L = tran01*tran12*tran23*p3c2L;
- %top view points in 0 frame
- P0AL = tran0A*PAL;
- P0A1L = tran0A*PA1L;
- P0A2L = tran0A*PA2L;
- P0A3L = tran0A*PA3L;
- P0Ac1 = tran0A*PAc1;
- P0Ac2 = tran0A*PAc2;
- P0Ac1L = tran0A*PAc1L;
- P0Ac2L = tran0A*PAc2L;
- hold on
- %get rid of all previously drawn lines
- lines = get(gca, 'Children');
- delete(lines);
- %draw axis
- line([0 0],[0 75],'LineWidth',2.75);
- line([0 75],[0 0],'LineWidth',2.75);
- line([400 400],[0 75],'LineWidth',2.75);
- line([400 475],[0 0],'LineWidth',2.75);
- %draw side view
- line([0 0],[10 250]);
- line([0 P0a(1)],[250 P0a(3)]);
- line([P0a(1) P0b(1)],[P0a(3) P0b(3)]);
- line([P0b(1) P0c(1)],[P0b(3) P0c(3)]);
- line([P0c1(1) P0c2(1)],[P0c1(3) P0c2(3)]);
- line([P0c1(1) P0c1L(1)],[P0c1(3) P0c1L(3)]);
- line([P0c2(1) P0c2L(1)],[P0c2(3) P0c2L(3)]);
- %draw top view
- line([400 P0A1L(1)+400],[0 P0A1L(2)]);
- line([400+P0A1L(1) P0A2L(1)+P0A1L(1)+400],[P0A1L(2) P0A2L(2)+P0A1L(2)]);
- line([P0A2L(1)+P0A1L(1)+400 P0A3L(1)+P0A2L(1)+P0A1L(1)+400],[P0A2L(2)+P0A1L(2) P0A3L(2)+P0A2L(2)+P0A1L(2)]);
- line([P0Ac1(1)+400 P0Ac2(1)+400],[P0Ac1(2) P0Ac2(2)]);
- line([P0Ac1(1)+400 P0Ac1L(1)+400],[P0Ac1(2) P0Ac1L(2)]);
- line([P0Ac2(1)+400 P0Ac2L(1)+400],[P0Ac2(2) P0Ac2L(2)]);
- %name axis
- text(-30,70,'Z');
- text(70,-30,'X');
- text(370,70,'Y');
- text(470,-30,'X');
- hold off
- %pause so everyone can see what changed on the frame
- pause(.1);
- end
- end
- end
- end
- %ask if they want to end the loop
- exit = input('1 to quit and 0 to continue: ');
- %Continue? Make exit = 1 for ending
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement