資源簡介
Matlab里面沒有提供直接以半徑和圓心位置畫圓的程序,該程序可以實現此功能,命令格式為:circle(radius,x0,y0, color )
代碼片段和文件信息
function?h=circle(rx0y0CNb)
%circle.m
%circle?adds?circles?to?the?current?plot
%
%check?the?number?of?input?argument
if?nargin<1r=[];end;
if?nargin==2error(‘Not?enough?arguments‘);end;
if?nargin<3x0=[];y0=[];end;
if?nargin<4C=[];end;
if?nargin<5Nb=[];end
%set?up?the?default?values
if?isempty(r)r=1;end;
if?isempty(x0)x0=0;end;
if?isempty(y0)y0=0;end;
if?isempty(Nb)Nb=300;end;
if?isempty(C)C=get(gca‘colororder‘);end
%work?on?the?variable?sizes
x0=x0(?:?);
y0=y0(?:?);
r=r(?:?);
Nb=Nb(?:?);
if?isstr(C)C=C(?:?);end;
if?length(x0)~=length(y0)error(‘length(x0)~=length(y0)‘);end
%how?many?rings?are?ploted
if?length(r)~=length(
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1366??2010-04-07?17:48??circle.m
-----------?---------??----------?-----??----
?????????????????1366????????????????????1
評論
共有 條評論