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: CBIG_GenerateALENullDist_EickhoffUnionAnalytical.m
    path of file: ./repos/CBIG/utilities/matlab/ALE
    
    the code of the file until where you have to start completion: function null_hist = CBIG_GenerateALENullDist_EickhoffUnionAnalytical(ale_mat, bin_width)

% null_hist = CBIG_GenerateALENullDist_EickhoffUnionAnalytical(ale_mat, bin_width)
%
% Generate a histogram of ALE values from individual experiments under a null hypothesis of spatial independence
% FORMAT null_hist = CBIG_Gener
    
function hist_vec = ConvertProb2Bins(prob_vec, num_bins)
  prob_vec = floor(prob_vec*num_bins)+1;
  [xi, m]  = knt2brk(prob_vec);

  hist_vec     = zeros(1, num_bins);
  hist_vec(xi) = m;
  hist_vec = hist_vec/sum(hist_vec);


% convolve two ALE histograms
function new_hist = ConvolveALEHistogram(hist_vec1, hist_vec2)
  index1 = find(hist_vec1 > 0);
  index2 = find(hist_vec2 > 0);

  num_bins = length(hist_vec2);
  new_hist = zeros(1, num_bins);
  for i = index1
      
      old_val1 = (i - 1)*1/num_bins;
      for j = index2
          
          old_val2 = (j - 1)*1/num_bins;
          new_val  = 1 - (1 - old_val1)*(1 - old_val2);
          
          new_hist(floor(new_val*num_bins)+1) = new_hist(floor(new_val*num_bins)+1) + hist_vec1(i)*hist_vec2(j);
      end