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

getSampleClustering(type)
function imageData = getSampleClustering(type)

    global workingSet;
    global workingSetT;
    global genes;

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

    if(strcmp(type, 'Correlation'))
        clustergram(workingSet', 'pdist', 'correlation', 'RowLabels', workingSetT, 'ColumnLabels', genes)
    end
    if(strcmp(type, 'Euclidean'))
        clustergram(workingSet', 'pdist', 'euclidean', 'RowLabels', workingSetT, 'ColumnLabels', genes)
    end

    % Create the output filename
    imageData = getBitMap(f);
    

Contact us at files@mathworks.com