How to plot sym array in given value
Show older comments
syms a1 a2 a4 a5;
d1=100;d2=250;d3=50;d4=250;d5=100;
% define transformation matrix
T_01=[sin(a1) 0 cos(a1) 0; -cos(a1) 0 sin(a1) 0; 0 -1 0 d1; 0 0 0 1];
T_12=[cos(a2) 0 sin(a2) d2*cos(a2); sin(a2) 0 -cos(a2) d2*sin(a2); 0 1 0 0; 0 0 0 1];
T_23=[-1 0 0 0; 0 0 1 0; 0 1 0 d3; 0 0 0 1];
T_34=[cos(a4) -sin(a4) 0 d4*cos(a4); sin(a4) cos(a4) 0 d4*sin(a4); 0 0 1 0; 0 0 0 1];
T_4H=[cos(a5) -sin(a5) 0 d5*cos(a5); sin(a5) cos(a5) 0 d5*sin(a5); 0 0 1 0; 0 0 0 1];
% Calculate center of E.E. frame
T_0H=T_01*T_12*T_23*T_34*T_4H;
P = transpose([0 0 0 1]);
P1_0=T_0H*P;
% give value
a1 = 0:pi/1000:pi/2;
a2 = 0:-pi/500:-pi;
a4 = 0:pi/1000:pi/2;
a5 = 0:-pi/1000:-pi/2;
%plot 501 point
for i=1:1:501
a1(i);a2(i);a4(i);a5(i);
plot3(P1_0(1),P1_0(2),P1_0(3));
end
I want to cnovert P1_0 to 4x1x501 double array, so can plot path in 3d space. How can i do that? Thank for your help.
Accepted Answer
More Answers (0)
Categories
Find more on Calculus 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!
