MATLAB两种方式绘制圆
1、第一,启动MATLAB,新建脚本(Ctrl+N),输入以下代码:close all; clear all; clcr=2; theta=0:pi/100:2*pi;x=r*cos(theta); y=r*sin(theta);rho=r*sin(theta);figure(1)plot(x,y,'-')hold on; axis equalfill(x,y,'c')figure(2)h=polar(theta,rho);set(h,'LineWidth',2)

3、第三,保存和运行上述脚本,在figure(2)中得到polar(theta,rho)绘制的圆。

5、第五,保存和运行上述增加后的脚本,在figure(3)中将plot(x,y),polar(x,y)绘制的圆画在了一张图上。

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:81
阅读量:69
阅读量:65
阅读量:62
阅读量:42