1
votes

I'm brand new to Matlab I need to plot p1-p4 on one compass graph with a different color for each. If I use hold on I can get them all to plot in different colors but they appear on a normal xy plane plot and I need the polar version.

p1(1) = 1j;
p1(2) = 1;
p2(1) = 2+1j;
p2(2) = 2-1j;
n3 = 1:4;
p3 = cos(-n3*pi/2)+1j*sin(-n3*pi/2);
n4 = 1:4;
p4 = (1+1j).^(n4);

hold on
compass(p4,'b');
compass(p3,'c');
compass(p2,'r');
compass(p1,'g');
1

1 Answers

0
votes

You have to plot the first element, and then execute hold on.

compass(p4,'b'); hold on
compass(p3,'c');
compass(p2,'r');
compass(p1,'g');

enter image description here