You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: hewma_plot_runlen.m
    path of file: ./repos/CanlabCore/CanlabCore/hewma_utility
    
    the code of the file until where you have to start completion: function [cl2,classes] = hewma_plot_runlen()
% Visualize a change_point map stored in hewma_cp.img
% (output from hewma2)
% and classify voxels into groupings based on CP
%
% :Usage:
% ::
%
%     [cl2,classes] = hewma_plot_runlen
%


    
function [cl2,classes] = hewma_plot_runlen()
% Visualize a change_point map stored in hewma_cp.img
% (output from hewma2)
% and classify voxels into groupings based on CP
%
% :Usage:
% ::
%
%     [cl2,classes] = hewma_plot_runlen
%


name = 'hewma_runlen.img';
%name = 'hewma_cp.img';


% ----------------------------------------------------
% initial viewing of CP map
% ----------------------------------------------------

cl = mask2clusters(name);

cluster_orthviews(cl);


% ----------------------------------------------------
% load data
% ----------------------------------------------------

v = spm_read_vols(spm_vol(name));
v2 = v(:); v2 = round(v2);
v2(abs(v) < eps | isnan(v)) = [];


% ----------------------------------------------------
% make histogram and get clusters (classifications) of CPs
% ----------------------------------------------------

nbins = unique(v2);
tor_fig; f1 = gcf; [h,x] = hist(v2,nbins); hh = bar(x,h); set(hh,'FaceColor',[.5 .5 .5])

nclasses = input('How many classes?');

err = 1; indx = 1;
while err
    try
        classes = kmeans(v2, nclasses);   % ,'start','uniform');
        err = 0;
    catch
    end