先用[x,y]=scircle1(o1,o2,r)来生成以(o1,o2)为圆心,r为半径的圆周上的散点[x,y],再用plot (x,y)就可以了 或者用polar极坐标来画,也是用描点法,a=0:0.1:2*pi;b=ones(size(a))*r;polar(a,b)也可以,具体的用法找帮助,很详细 ...
1 2 3 4 5 6 ; % x 2 1 3 5 6 7]; % y figure(1); hold on; axis equal;for i = 1:size(data,2)drawcircle(1,data(2,i),data(3,i),data(1,i));end end function drawcircle(n,x,y,radius)定义画圆函数, n 为 figure 号, x,y 定义圆心, radius 为半径 angle = ...
yy=5;r=2;t=0:0.1:2*pi;% 利用参数方程 x=xx+r*cos(t);y=yy+r*sin(t);plot(x,y,'r')%r表示颜色红色 grid on%加网格 采纳啊 亲
theta=0:pi/100:2*pi; %角度[0,2*pi]R=2; %半径70 x=R*cos(theta)+x0;y=R*sin(theta)+y0;plot(x,y,'-')axis equal
可用如下代码,圆心,半径可修改:c=[0 0]; %圆心 r=1; %半径 a=0:0.1:2*pi;x=c(1)+r*cos(a);y=c(2)+r*sin(a);plot(x,y,'r.')
rectangle handle, to see a list of rectangle object properties and their current values. Execute SET(H)to see a list of rectangle object properties and legal property values.以原点为中心,画一个半径2的圆 rectangle('Curvature', [1 1], 'Position',[0,0,2,2]); axis image ...
[X,Y,Z] = sphere(64); % 球体坐标figure;surf(X,Y,Z);hold onhidden onx = linspace(-1.5,1.5,100);y = linspace(-1.5,1.5,100);[X,Y] = meshgrid(x,y);surf(X,Y,-X-Y); % 平面shading interp;