Pull the figure and hold commands out of the for loop:
swvec(1)=0.1;
swvec(2)=0.2;
swvec(3)=0.3;
figure
hold on
for i=1:3
a= swvec(i);
theta = [0 30 60 90];
b = (1/a);
v1 = sind(theta).*a;
v2 = cosd(theta).*a;
plot (v1,v2)
swvec(3)
end
hold off
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!