⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ncirc.m

📁 控制系统计算机辅助设计——MATLAB语言与应用(源代码)
💻 M
字号:
function c=ncirc(n)
%NCIRC  Calculates N-circles.
%       NCIRC(N) returns a complex matrix with
%       one circle per column.
%       N is the vector of N-circle values in degrees.
%       0 degrees and multiples of 180 degrees and
%       positive degree N-circles are not supported.
%       See also MCIRC,CIRC,ARC

%       Dr M.P. Ford 4th August 1987
% Copyright (c) 1987 by GEC Engineering Research Centre & Cambridge Control Ltd
% MRN0026

if min(size(n))~=1
   error('N must be a vector');
end
if any(n>=0)
   error('N-circles with zero or positive degrees not supported');
end
if any(rem(n,180)==0)
   error('N-circles that are multiples of 180 degrees not supported');
end
n=n.*(pi/180);
cent=-0.5+(sqrt(-1)./(2*tan(n)));
ang=[1599 (+1500:-100:+500) (+400:-40:+80) (+40:-10:-30)...
     (-40:-40:-360) (-400:-100:-1500) -1599].';
ang=ang.*(pi/1600);
for i=1:length(n)
    c(:,i)=cent(i) + cent(i).*exp(sqrt(-1).*ang);
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -