>
<span class="comment">%   CC = [ C0(:) C1(:) C2(:) ... ]</span>
<span class="comment">%   GG = [ G0(:) G1(:) G2(:) ... ]</span>
<span class="comment">%</span>

CC = zeros(n,n,m+1);
GG = zeros(n,n,m+1);
CC(:,:,1) = C0 * eye(n);
<span class="comment">% segment capacitances and conductances</span>
k3 = 1;
<span class="keyword">for</span> k1 = 1 : 5,
    <span class="keyword">for</span> k2 = k1 + 1 : 6,
        CC([k1,k2],[k1,k2],k3) = beta *[1, 0; 0,1]*L(k3);
        GG([k1,k2],[k1,k2],k3) = alpha*[1,-1;-1,1