Code covered by the BSD License  

Highlights from
Mutual Information In probability theory and information theory

from Mutual Information In probability theory and information theory by Guangdi Li
Code for marginally and conditional mutual information in probability and information theory

DiscardNoneExist( OriginalData,TestVector )
function  [Discard,TotalNumber ] = DiscardNoneExist( OriginalData,TestVector )
% This function return a matric indicating the useful rows in OriginalData.  
% Input:  TestVector is the variables in OriginalData
%         TestVector is the set of variables.
% Output: Discard is a tag matric showing which rows in OriginalData are used

% U is the given value when the data is invalid. 
N = size(OriginalData,1); % U;  
Discard = zeros(1,N);
TotalNumber = 0;
  for p=1:N
      d = 1;
      for q = 1:size(TestVector,2)
          if OriginalData(p,TestVector(q)) == -1   % Here we assume U =-1
             d = 0;
             break;
          end
      end
      if d==0 
          Discard(p) = 1;
          TotalNumber = TotalNumber + 1;
      end
  end
end

Contact us at files@mathworks.com