Azzera filtri
Azzera filtri

Issue in plotting two graphs on the same script for Robot Manipulator

2 visualizzazioni (ultimi 30 giorni)
Hi, I am trying to plot two graphs on the same script for a robot manipulator before and after rotation of its joint angles. However, I am getting an issue here. I am getting the same graphs two times. But when I run them seperately, I get different results. Below is my code:
%Link lengths for this example:
L1 = 4;
L2 = 3;
L3 = 2;
% Writing DH parameters in the order theta, d, a, alpha:
DH = [0 0 0 0; 0 0 L1 0; 0 0 L2 0]
%Initialising Links with the DH parameters
L(1) = Link(DH(1,1:4));
L(2) = Link(DH(2,1:4));
L(3) = Link(DH(3,1:4));
%Defining the robot:
RRR_Robot = SerialLink(L,'name','This is a Planar Robot')
%Initial joint angles:
qi = [0 0 0];
%Desired joint angles:
qd = [0, pi/4, pi/4];
Ti = fkine(RRR_Robot, qi)
Td = fkine(RRR_Robot, qd)
subplot(1,2,1), plot(RRR_Robot, qi), subplot(1,2,2), plot(RRR_Robot, qd)
I am attaching the figures for reference. I tried subplot and figure methods but I get the same result (i.e., plot 2 is being displayed two times).
Could anyone please help me here?
Thanks
Sampath

Risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by