drawin.m

来自「AFD - Advanced Filter Design using MATLA」· M 代码 · 共 57 行

M
57
字号
function dr = drawin(a,b,t,p,s,F,dc)

% drawin.m  Draw input
% 7:55PM  9/18/99
%
%            Album of Analog Filter Realizations
%
%   Authors: Dejan V. Tosic, Miroslav D. Lutovac, 1999.02.21
%                 tosic@telekom.etf.bg.ac.yu
%                 lutovac@galeb.etf.bg.ac.yu
%
%   Copyright (c) 1999 by Tosic & Lutovac
%   $Revision: 1.0 $  $Date: 1999/02/21 02:17:42 $
%
%   References:
%        Miroslav D. Lutovac, Dejan V. Tosic, Brian L. Evans
%           Advanced Filter Design for Signal Processing
%                   Using MATLAB and Mathematica
%

xy = 0:0.05:1;

if p == 0
% {a,b},{a+s*0.1,b}
 x = [a,a+s*0.1];   y = [b,b];
 line(x,y,'Color',dc)
 x1 = a+s*0.15 + s*0.05*sin(2*pi*xy);
 y1 = b + s*0.05*cos(2*pi*xy);
 line(x1,y1,'Color',dc)
 text(a+s*0.275,b,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','left','VerticalAlignment','middle')
elseif p == 1
 x = [a,a];   y = [b,b+s*0.1];
 line(x,y,'Color',dc)
 x1 = a + s*0.05*sin(2*pi*xy);
 y1 = b+s*0.15 + s*0.05*cos(2*pi*xy);
 line(x1,y1,'Color',dc)
 text(a,b+s*0.275,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','center','VerticalAlignment','bottom')
elseif p == 2
 x = [a,a-s*0.1];   y = [b,b];
 line(x,y,'Color',dc)
 x1 = a-s*0.15 + s*0.05*sin(2*pi*xy);
 y1 = b + s*0.05*cos(2*pi*xy);
 line(x1,y1,'Color',dc)
 text(a-s*0.275,b,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','right','VerticalAlignment','middle')
else
 x = [a,a];   y = [b,b-s*0.1];
 line(x,y,'Color',dc)
 x1 = a + s*0.05*sin(2*pi*xy);
 y1 = b-s*0.15 + s*0.05*cos(2*pi*xy);
 line(x1,y1,'Color',dc)
 text(a,b-s*0.275,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','center','VerticalAlignment','top')
end

⌨️ 快捷键说明

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