MATLAB: How Can I Select a Specific Matrix from a List

adjacency matrixgraphgraph theorygraphsmathematicMATLABmatrixsquare matrixvertex

Hello All,
Here is What I have So Far. When Ran, this Program produces two distinct matrices in what appears to be an 2×1 vertex in (the first entry (1×1) is one matrix, and the second entry (2×1) is another). I was wondering, how can I edit my code to be able to pull out and assign a label to each matrix respectively? I.E. A = 1st Matrix, M = 2nd Matrix
N = 3;
M = N * (N-1) / 2;
numgraph = 2^M;
for K = 1 : numgraph
sq = squareform(choices(K,:));
sq = tril(1-sq) + triu(sq) - eye(N);
if sq(1,2)+sq(2,1) > 1; continue; end
if any(sum(sq,1)<1) || any(sum(sq,2)<1); continue; end
disp(sq)
end

Best Answer

N = 3;
M = N * (N-1) / 2;
numgraph = 2^M;
choices = dec2bin(0:numgraph-1, M) - '0';
graphs = cell(numgraph,2);
graphlabels = {'A', 'M'}
used = 0;
for K = 1 : numgraph
sq = squareform(choices(K,:));
sq = tril(1-sq) + triu(sq) - eye(N);
if sq(1,2)+sq(2,1) > 1; continue; end
if any(sum(sq,1)<1) || any(sum(sq,2)<1); continue; end;
used = used + 1;
graphs{used,1} = graphlabels{used};
graphs{used,2} = sq;
end
graphs(used+1:end, :) = [];