📄 f_drawadapt.m
字号:
function f_drawadapt (h,colors,fsize)
%F_DRAWADAPT: Draw a block diagram for GUI module g_adapt
%
% Usage: f_drawadapt (h,colors,fsize);
%
% Inputs:
% h = axes handle
% colors = array of plotting colors
% fsize = font size
% Initialize
ylim = get(h,'Ylim');
xlim = get(h,'Xlim');
y0 = (ylim(2)-ylim(1))/2;
axes (h);
hold on
arrow = 0.1;
boxwidth = 0.2;
boxheight = 0.1;
circle = 0.02;
summer = 0.06;
cx = 0.5;
cy = y0+0.25*boxheight;
% Draw block diagram
f_circle (cx-0.5*boxwidth-2*arrow,cy,circle,colors(1,:));
text (cx-0.5*boxwidth-2*arrow-0.05,cy,'x(k)','Color',colors(1,:),'HorizontalAlignment','center',...
'FontName','FixedWidthFontName','FontSize',fsize);
f_line (cx-0.5*boxwidth-2*arrow+0.5*circle,cy,1,0,arrow-0.5*circle,colors(1,:))
f_line (cx-0.5*boxwidth-arrow,cy-0.75*boxheight,0,1,1.5*boxheight,colors(1,:))
f_vector (cx-0.5*boxwidth-arrow,cy-0.75*boxheight,1,0,arrow,colors(1,:))
f_vector (cx-0.5*boxwidth-arrow,cy+0.75*boxheight,1,0,arrow,colors(1,:))
f_block (cx-0.5*boxwidth,cy-1.25*boxheight,boxwidth,boxheight,colors(3,:))
text (cx,cy-0.5*boxheight,'Adaptive','HorizontalAlignment','center',...
'FontName','FixedWidthFontName','FontSize',fsize)
text (cx,cy-1.0*boxheight,'filter','HorizontalAlignment','center',...
'FontName','FixedWidthFontName','FontSize',fsize)
f_block (cx-0.5*boxwidth,cy+0.25*boxheight,boxwidth,boxheight,colors(2,:))
text (cx,cy+0.75*boxheight,'Black box','HorizontalAlignment','center',...
'FontName','FixedWidthFontName','FontSize',fsize)
f_line (cx+0.5*boxwidth,cy+0.75*boxheight,1,0,1.5*arrow,colors(2,:))
text (cx+0.5*boxwidth+0.75*arrow,cy+0.75*boxheight+0.025,'d(k)','Color',colors(2,:),...
'HorizontalAlignment','center','FontName','FixedWidthFontName','FontSize',fsize)
f_vector (cx+0.5*boxwidth+1.5*arrow,cy+0.75*boxheight,0,-1,0.75*boxheight-0.5*summer,colors(2,:))
f_circle (cx+0.5*boxwidth+1.5*arrow,cy,summer,colors(1,:))
text (cx+0.5*boxwidth+1.5*arrow,cy,'+','Color',colors(1,:),'HorizontalAlignment','center',...
'FontName','FixedWidthFontName','FontSize',fsize)
f_line (cx+0.5*boxwidth,cy-0.75*boxheight,1,0,1.5*arrow,colors(3,:))
text (cx+0.5*boxwidth+0.75*arrow,cy-0.75*boxheight+0.025,'y(k)','Color',colors(3,:),...
'HorizontalAlignment','center','FontName','FixedWidthFontName','FontSize',fsize)
f_vector (cx+0.5*boxwidth+1.5*arrow,cy-0.75*boxheight,0,1,0.75*boxheight-0.5*summer,colors(3,:))
f_line (cx+0.5*boxwidth+1.5*arrow+0.5*summer,cy,1,0,arrow,colors(1,:))
text (cx+0.5*boxwidth+2*arrow+0.5*summer,cy+0.025,'e(k)','Color',colors(1,:),...
'HorizontalAlignment','center','FontName','FixedWidthFontName','FontSize',fsize)
f_line (cx+0.5*boxwidth+2.5*arrow+0.5*summer,cy,0,-1,1.75*boxheight,colors(1,:))
f_line (cx+0.5*boxwidth+2.5*arrow+0.5*summer,cy-1.75*boxheight,-1,0,0.5*boxwidth+2.5*arrow+0.5*summer,colors(1,:))
f_vector (cx,cy-1.75*boxheight,0,1,0.5*boxheight,colors(1,:))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -