keyword">if</span> m1~=m2
    error(<span class="string">'Input adjacency matrix for horizontal graph must be square'</span>);
<span class="keyword">end</span>


<span class="keyword">if</span> n1~=m1
    error(<span class="string">'Input adjacency matrices must be of the same size'</span>);
<span class="keyword">end</span>

n = n1;                     <span class="comment">% number of cells</span>

<span class="keyword">if</span> nargin &lt;3
    rho = 0;
<span class="keyword">end</span>

<span class="keyw