-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShowMCB.m
40 lines (35 loc) · 1.75 KB
/
ShowMCB.m
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
%{
***************************************************************************************
* Abstract: More detailed view of a Minimum Cycle Basis
* Uses: This file has been compiled using Matlab R2017b
* Author: Michael Vasquez Otazu
* Email: [email protected]
* History: V1.0 - first release
********************************* START LICENSE BLOCK *********************************
* The MIT License (MIT)
* Copyright (C) 2017 Michael Vasquez Otazu
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, subject to the following conditions:
*
* The above Copyright notice and this Permission Notice shall be included in all copies
* or substantial portions of the Software.
********************************** END LICENSE BLOCK **********************************
%}
function [MCB_show, MCB_weight] = ShowMCB(G, MCB)
%% Augment MCB matrix
MCB_show = MCB;
MCB_weight = sum(MCB_show(:,end));
%MCB_show = circshift(MCB_show, [0 -rows]); % move weights at first column
%% Add labels
rowNames = {};
colNames = {};
[rows,cols] = size(MCB_show);
rowNames = {}; for i = 1:rows, rowNames{end+1} = strcat('Cycle',num2str(i)); end;
colNames = {}; for j = 1:cols-1, colNames{end+1} = strcat('Edge',num2str(j)); end; colNames{end+1} = 'Weight';
MCB_show = array2table(MCB_show,'RowNames',rowNames,'VariableNames',colNames); % Add labels
return
end