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

📄 drawcap.m

📁 AFD - Advanced Filter Design using MATLABMiroslav D. Lutovac, Dejan V. Tosicversion 1.00 released 15
💻 M
字号:
function dr = drawc(c,d,f,n,t,p,s,F,dc)

% drawc.m  Draw capacitor
% 1:33  22/2/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
%

a=(f+c)/2-0.4*s;
b=d;
g=c;
h=(f+d)/2-0.4*s;
xy = 1.1*s;

if p == 0
 x1 = a + s*[(c-a)/s, 0.35];   y1 = b + s*[   0,   0];
 x2 = a + s*[   0.35, 0.35];   y2 = b + s*[-0.2, 0.2];
 x3 = a + s*[(f-a)/s, 0.45];   y3 = b + s*[   0,   0];
 x4 = a + s*[   0.45, 0.45];   y4 = b + s*[-0.2, 0.2];
 line(x1,y1,'Color',dc)
 line(x3,y3,'Color',dc)
 line(x2,y2,'LineWidth',xy,'Color',dc)
 line(x4,y4,'LineWidth',xy,'Color',dc)
 text(a+s*0.4,b+s*0.25,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','center','VerticalAlignment','bottom')
elseif p == 1
 x1 = g + s*[      0, 0   ];  y1 = h + s*[(d-h)/s, 0.35];
 x2 = g + s*[   -0.2, 0.2 ];  y2 = h + s*[   0.35, 0.35];
 x3 = g + s*[      0, 0   ];  y3 = h + s*[(f-h)/s, 0.45];
 x4 = g + s*[   -0.2, 0.2 ];  y4 = h + s*[   0.45, 0.45];
 line(x1,y1,'Color',dc)
 line(x3,y3,'Color',dc)
 line(x2,y2,'LineWidth',xy,'Color',dc)
 line(x4,y4,'LineWidth',xy,'Color',dc)
 text(g-s*0.3,h+s*0.4,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','right','VerticalAlignment','middle')
elseif p == 2
 x1 = a + s*[(c-a)/s, 0.35];   y1 = b + s*[   0,   0];
 x2 = a + s*[   0.35, 0.35];   y2 = b + s*[-0.2, 0.2];
 x3 = a + s*[(f-a)/s, 0.45];   y3 = b + s*[   0,   0];
 x4 = a + s*[   0.45, 0.45];   y4 = b + s*[-0.2, 0.2];
 line(x1,y1,'Color',dc)
 line(x3,y3,'Color',dc)
 line(x2,y2,'LineWidth',xy,'Color',dc)
 line(x4,y4,'LineWidth',xy,'Color',dc)
 text(a+s*0.4,b-s*0.25,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','center','VerticalAlignment','top')
else
 x1 = g + s*[      0, 0   ];  y1 = h + s*[(d-h)/s, 0.35];
 x2 = g + s*[   -0.2, 0.2 ];  y2 = h + s*[   0.35, 0.35];
 x3 = g + s*[      0, 0   ];  y3 = h + s*[(f-h)/s, 0.45];
 x4 = g + s*[   -0.2, 0.2 ];  y4 = h + s*[   0.45, 0.45];
 line(x1,y1,'Color',dc)
 line(x3,y3,'Color',dc)
 line(x2,y2,'LineWidth',xy,'Color',dc)
 line(x4,y4,'LineWidth',xy,'Color',dc)
 text(g+s*0.3,h+s*0.4,t,'FontName','Times','FontSize',F,...
   'HorizontalAlignment','left','VerticalAlignment','middle')
end

⌨️ 快捷键说明

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