  [ynum, xnum] = nsubplots(K);
    <span class="keyword">if</span> K==10
        ynum = 2; xnum = 5;
    <span class="keyword">end</span>
    TK = model{i}.cpd.T;
    mixweightK = model{i}.mixWeight;
    <span class="keyword">for</span> j=1:K
        subplot(ynum, xnum, j);
        imagesc(reshape(TK(j, 2, :), 28, 28));
        colormap(<span class="string">'gray'</span>);
        title(sprintf(<span class="string">'%1.2f'</span>, mixweightK(j)), <span class="string">'fontsize'</span>, 30);
        axis <sp