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: remove_spikes.m
    path of file: ./repos/BPL/bottomup/skeleton
    
    the code of the file until where you have to start completion: %
% Remove a path between two nodes,
% where one is a singleton (only one edge), and the 
% path is shorter than the ink width (set as a parameter)
%
function T = remove_spikes(T)

    ps = defaultps_bottomup();
    dist_rmv = ps.min_spike_distance; % remove spikes that 
    
function T = remove_spikes(T)

    ps = defaultps_bottomup();
    dist_rmv = ps.min_spike_distance; % remove spikes that are shorter than this, 
                  % which is approximately the ink width (like 4)

    degree = sum(T.E);
    degree1 = find(degree==1);
    
    tormv_node = false(T.n,1);
    tormv_edge = false(size(T.S));
    for i=1:length(degree1)
       node1 = degree1(i);
       node2 = find(T.E(node1,:));
       if degree(node2)==1
           continue % don't remove two singletons conjoined 
       end