function cluster_examples(filename)
    markers = {'s', 'o', 'd', 'v', '^', '*', '+', 'p', 'x', '<', '>', 'h', '.', ...
        's', 'o', 'd', 'v', '^', '*', '+', 'p', 'x', '<', '>', 'h', '.', ...
        's', 'o', 'd', 'v', '^', '*', '+'};

    data = load(filename, ' ');
    [n, m] = size(data);
    numClusters = max(data(:,m));
    fprintf('\nData set: %s\n\tNumber of Clusters: %d\n', filename, ...
        numClusters);
    h = scatter(data(data(:,m)==1, 1), data(data(:,m)==1,2), markers{1});
    hold on;
    for j=2:numClusters
        scatter(data(data(:,m)==j,1), data(data(:,m)==j,2), markers{j});
    end
    
    % Save figure to multiple formats
    [pathstr,name,ext] = fileparts(filename);
    savefig(sprintf('%s.fig', name));
    print('-depsc2', '-r300', name)
    print('-dpng', '-r300', name)
    
    opts = statset('Display', 'final');
    [kms,centers] = kmeans(data(:,1:2), numClusters, 'distance', 'sqEuclidean', ...
        'Replicates', 5, 'Options', opts);
    h2 = figure;
    scatter(data(kms==1,1), data(kms==1,2), markers{1});
    hold on;
    legendStr{1} = 'cluster 1';
    for j=2:numClusters
        scatter(data(kms==j,1), data(kms==j,2), markers{j});
        legendStr{j} = sprintf('cluster %d', j);
    end
    legendStr{j+1} = 'Centroids'; 
    plot(centers(1,1), centers(1,2), 'kx', 'MarkerSize', 12, 'LineWidth', 2);
    for j=2:numClusters
        plot(centers(j,1), centers(j,2), 'kx', 'MarkerSize', 12, 'LineWidth', 2);
    end
    legend(legendStr, 'Location', 'EastOutside', 'FontSize', 14);
%     title(sprintf('Data: %s',name), 'FontSize', 14);
    
    clustname = sprintf('%s_%d%s', name, numClusters, 'clust');
    savefig(sprintf('%s.fig', clustname));
    print('-depsc2', '-r300', clustname)
    print('-dpng', '-r300', clustname)
    
    
end
