Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function plot_connection_matrices(IDS)
info = extract_info_connection_matrix(IDS);
for kk=1:info.ntotcircuits
figure
mat = info.pf_active.circuit{kk}.connections;
b = zeros([size(mat)]+1);
b(1:end-1, 1:end-1) = mat;
pcolor(b)
yti = [1:size(b,1)]+0.5;
xti = [1:size(b,2)]+0.5;
ylab = cellstr(num2str([1:size(b,1)-1]'));
index = 0;
xlab = {};
% Get the labels
for ii=1:info.ntotsupplies
index = index +1;
if any(ii==info.pf_active.circuit{kk}.supplies_ind_belonging_to_circuit)
addcolor = '\color{red}';
else
addcolor = '\color{green}';
end
xlab{index} = [addcolor info.pf_active.supply{ii}.name 'in'];
index = index +1;
xlab{index} = [addcolor info.pf_active.supply{ii}.name 'out'];
end
for ii=1:info.ntotcoils
if any(ii==info.pf_active.circuit{kk}.coils_ind_belonging_to_circuit)
addcolor = '\color{red}';
else
addcolor = '\color{black}';
end
index = index +1;
xlab{index} = [addcolor info.pf_active.coil{ii}.name 'in'];
index = index +1;
xlab{index} = [addcolor info.pf_active.coil{ii}.name 'out'];
end
shg
axis ij
ax = gca;
colormap(bone(2))
xlabel('Element name. (red) Elemement belonging to circuit. (green) power supplies. (black) coils');
ylabel('Node');
title(['Circuit ' num2str(kk) ': ' info.pf_active.circuit{kk}.name])
set(ax,'Xtick', xti, 'Ytick', yti, 'XTickLabel', xlab, 'YTickLabel', ylab')
end
end