from Web Deployment Using MATLAB by Todd Flanagan
A web-based gene analysis demonstration using MATLAB Builder for COM

getKMean(k)
function imageData = getKMean(k)

    global workingSet;
    global workingSetT;

    f = figure('Visible', 'off');


    [cidx, ctrs] = kmeans(workingSet, k,'dist','correlation','rep',5,'disp','final');

    for c = 1:k
        subplot(3,3,c);
        plot(workingSetT,workingSet((cidx == c),:)');
        title(['Cluster ' num2str(c)]);
        xlabel('time')
        ylabel('LogRatios')
        axis tight
    end


    imageData = getBitMap(f);
    

Contact us at files@mathworks.com