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

getGeneClustering(distanceType)
function imageData = getGeneClustering(distanceType)

    global workingSet;
    global workingSetT;
    global genes;
    

    f = figure('Visible', 'off', 'Tag','ClustergramFigure');
    
    if(strcmp(distanceType, 'Correlation'))
        clustergram(workingSet, 'pdist', 'correlation', 'RowLabels', genes, 'ColumnLabels', workingSetT)
    end
    if(strcmp(distanceType, 'Euclidean'))
        clustergram(workingSet, 'pdist', 'euclidean', 'RowLabels', genes, 'ColumnLabels', workingSetT)
    end

    imageData = getBitMap(f);
    
    close(f);

Contact us at files@mathworks.com