📄 fm_xy.m
字号:
function fm_xy(flag)% FM_XY draw network topology%% FM_XY(FLAG)% FLAG 'ytree' -> graph on a circle% 'etree' -> elimination tree%%Author: Federico Milano%Date: 11-Nov-2002%Version: 1.0.0%%E-mail: fmilano@thunderbox.uwaterloo.ca%Web-site: http://thunderbox.uwaterloo.ca/~fmilano%% Copyright (C) 2002-2005 Federico Milano%% This toolbox is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2.0 of the License, or% (at your option) any later version.%% This toolbox is distributed in the hope that it will be useful, but% WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANDABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU% General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this toolbox; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,% USA.global Line Bus Varname File Themeif isempty(Line.con) fm_disp('No static network is loaded. Network tree cannot be drawn.',1) returnendif isempty(Bus.con) fm_disp('No data is loaded. Network tree cannot be drawn.',1) returnendswitch flagcase 'ytree' a = 6.2832/Bus.n; t = [0:a:6.2832-a]'; xy = [sin(t), cos(t)]; figure; p = 1:Bus.n; %colamd(Line.Y); gplot(Line.Y(p,p),xy) hold on h = plot(xy(:,1),xy(:,2),'ro'); set(h,'MarkerFaceColor',Theme.color08) hold off title(['Graph Representation of "',strrep(File.data,'_','-'),'" Network']) limite = 1.5; xlim([-limite limite]); ylim([-limite limite]); for i = 1:Bus.n h = text(1.1*xy(i,1),1.1*xy(i,2),strrep(Varname.bus(p(i)),'_',' ')); if xy(i,1) < 0; set(h,'HorizontalAlignment','right'); end if abs(xy(i,1)) < 1e-2; set(h,'HorizontalAlignment','center'); end end set(gca,'XTick',[],'YTick',[]);case 'etree' figure etreeplot(Line.Y,'ro','b') title(['Elimination Tree of "',strrep(File.data,'_','\_'),'" Network.'])end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -