This repository has been archived on 2021-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
NC/mp2/Project.2.Maggioni.Claudio/ex3.m

17 lines
435 B
Mathematica
Raw Normal View History

2020-10-04 15:49:37 +00:00
clear;
clc;
load('householder/housegraph.mat')
names = split(strtrim(convertCharsToStrings(name')));
counts = full(sum(A, 2));
ranks = sortrows([counts, (1:size(counts,1))'], 'descend');
for i = 1:size(ranks, 1)
fprintf("%14s %2d: ", names(ranks(i, 2)), ranks(i, 1)-1);
for j = 1:size(A, 2)
if ranks(i, 2) ~= j && A(ranks(i, 2), j) > 0
fprintf("%s, ", names(j));
end
end
fprintf("\n");
end