MATLAB画圆
来源:互联网 发布:网络自动备份软件 编辑:程序博客网 时间:2024/06/16 05:52
***************************************这是一种思路*****************************************
通过坐标变换
function H=circle(center,radius,NOP,style)
%---------------------------------------------------------------------------------------------
% H=CIRCLE(CENTER,RADIUS,NOP,STYLE)
% This routine draws a circle with center defined as
% a vector CENTER, radius as a scaler RADIS. NOP is
% the number of points on the circle. As to STYLE,
% use it the same way as you use the rountine PLOT.
% Since the handle of the object is returned, you
% use routine SET to get the best result.
%
% Usage Examples,
%
% circle([1,3],3,1000,':');
% circle([2,4],2,1000,'--');
%
% Zhenhai Wang <zhenhai@ieee.org>
% Version 1.00
% December, 2002
%---------------------------------------------------------------------------------------------
if (nargin <3),
error('Please see help for INPUT DATA.');
elseif (nargin==3)
style='b-';
end;
THETA=linspace(0,2*pi,NOP);
RHO=ones(1,NOP)*radius;
[X,Y] = pol2cart(THETA,RHO);
X=X+center(1);
Y=Y+center(2);
H=plot(X,Y,style);
axis square;
****************************************另一种思路*****************************************
通过sin(x)^2+cos(x)^2=1也可以画出圆
x=linspace(0,10,100);
y=linspace(0,10,100);
plot(sin(x),cos(y));
axis equal;
- MATLAB画圆
- matlab 画圆
- matlab 画圆~
- MATLAB 画圆
- MATLAB画圆
- matlab
- Matlab
- MATLAB
- matlab
- matlab
- matlab
- matlab
- MATLAB
- matlab
- Matlab
- MATLAB
- MATLAB
- matlab
- jQuery 弹出层实例
- C#委托与事件
- linux分区
- C中的scanf不等待输入的原因及解决办法
- linux so动态库调用例子
- MATLAB画圆
- wince usb驱动代码详解
- Linux系统攻略 用UUID在Fstab中挂载分区
- 文件系统类型ext2/ext3/physical volume (LVM)/software RAID/swap/vfat的说明
- ORACEL EBS之FSG报表
- Linux中chkconfig命令
- 再论逻辑地址,线性地址和物理地址
- EBS_财务报表生成器(FSG)的设置
- extjs jsonreader groupgrid