%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Remove the zero data points in the xyz data %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function xyz_data_without_zeros = removeZeros(xyz_data)

n1 = size(xyz_data, 1);
n2 = sum(xyz_data(:, 3) ~= 0);
xyz_data_without_zeros = zeros(n2, 3);

counter2 = 1;
for i=1:n1
    
    if(xyz_data(i, 3) ~= 0)
        
        xyz_data_without_zeros(counter2, 1) = xyz_data(i, 1);
        xyz_data_without_zeros(counter2, 2) = xyz_data(i, 2);
        xyz_data_without_zeros(counter2, 3) = xyz_data(i, 3);
        counter2 = counter2 + 1;
        
    end
    
end

