HOME> 本届世界杯> 五种MATLAB画圆方式程序

五种MATLAB画圆方式程序

clear,clc % 方法一:使用隐函数的方法来绘制. hold on ezplot('x^2+y^2-8') % 方法二:转换成参数函数来绘制图形. syms x y t x=2*sin(t); y=2*cos(t); % 程序如下...

clear,clc

% 方法一:使用隐函数的方法来绘制.

hold on

ezplot('x^2+y^2-8')

% 方法二:转换成参数函数来绘制图形.

syms x y t

x=2*sin(t);

y=2*cos(t);

% 程序如下:

t=0:pi/100:2*pi;

x=2*sin(t);

y=2*cos(t);

plot(x,y,'r')

% 方法三:转换成匿名函数来绘制图形.

t1=0:pi/100:2*pi;

x1=@(tt)2*sin(tt)+1;

y1=@(tt)2*cos(tt)+2;

fplot(x1,y1,'g')

hold off

%{

r=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 equal

fill(x,y,'c')

%}

% 方法四:极坐标系绘制图形.

figure(2)

h=polar(theta,rho);

set(h,'LineWidth',2)

%法5利用rectangle函数

%rectangle函数使用说明https://jingyan.baidu.com/article/ca00d56c5abf86e99eebcf34.html

figure(3);

r = 10;%半径

a = 10;%横坐标

b = 10;%纵坐标

para = [a-r/2, b-r/2, r, r];

rectangle('Position', para, 'Curvature', [1 1]);

axis equal


运动过后大腿肌肉酸痛怎么办 ​董洁的电影作品有哪些好看(盘点董洁最受好评的十部影视作品)