📄 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-2006 Federico Milano
global Line Bus Varname File Theme
if isempty(Line.con)
fm_disp('No static network is loaded. Network tree cannot be drawn.',1)
return
end
if isempty(Bus.con)
fm_disp('No data is loaded. Network tree cannot be drawn.',1)
return
end
switch flag
case '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 + -