为什么会出错啊,请教各位。
Show older comments
xmin=-2;
xmax=6;
ymin=-2;
ymax=4;
theta=linspace(0,2*pi,200);
x_circle=cos(theta);
y_circle=sin(theta);
theta_slanted_line_array=linspace(0,pi/4,100);
for i=1:length(theta_slanted_line_array)
theta_slanted_line=theta_slanted_line_array(i);
figure(1);clf;hold on;
plot(x_circle,y_circle,'k-','linewidth',2);
plot([xmin,xmax],[0,0],'b','linewidth',2);
plot([-1,xmax],[0,tan(theta_slanted_line)*(xmax+1)],'r','linewidth',2);
plot(2*cos(theta_slanted_line)^2-1,2*cos(theta_slanted_line)*sin(theta_slanted_line),'b','linewidth',2);
axis equal;
axis([xmin,xmax,ymin,ymax]);
grid on;box on;
drawnow;
print('-r200','-dpng',['figure/figure_1_' num2str(i,'fig%05d') '.png']);
end
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB 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!