strip_zeros_and_nan value out of the input matrix
0001 0002 function newMatrix = distribution(matrix) 0003 %strip_zeros_and_nan value out of the input matrix 0004 0005 newMatrix = zeros(0,2); 0006 for i = 1: size(matrix,1) 0007 tempTrackArray = []; 0008 for j = 1: size(matrix,2) 0009 if (matrix(i,j) ~= 0 )&& ~isnan(matrix(i,j)) 0010 tempTrackArray = [tempTrackArray matrix(i,j)]; 0011 end 0012 end 0013 if ~isempty(tempTrackArray) 0014 newMatrix(end+1,:) = [mean(tempTrackArray(:)) std(tempTrackArray(:))]; 0015 end 0016 end 0017 end