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: gtom.m
    path of file: ./repos/CanlabCore/CanlabCore/External/2019_03_03_BCT
    
    the code of the file until where you have to start completion: function gt = gtom(adj,numSteps)
%GTOM       Generalized topological overlap measure
%
%   gt = gtom(adj,numSteps);
%
%   The m-th step generalized topological overlap measure (GTOM) quantifies
%   the extent to which a pair of nodes have similar m-th step neighbors.
%   Mth-step neighbors are nodes that are reachable by a path of at most
%   length m.
%
%   This function computes the the M x M generalized topological overlap
%   measure (GTOM) matrix for number of steps, numSteps. 
%
%   Inputs:       adj,    adjacency matrix (binary,undirected)
%            numSteps,    number of steps
%
%   Outputs:       gt,    GTOM matrix
%
%   NOTE: When numSteps is equal to 1, GTOM is identical to the topological
%   overlap measure (TOM) from reference [2]. In that case the 'gt' matrix
%   records, for each pair of nodes, the fraction of neighbors the two
%   nodes share in common, where "neighbors" are one step removed. As
%   'numSteps' is increased, neighbors that are furter out are considered.
%   Elements of 'gt' are bounded between 0 and 1.  The 'gt' matrix can be
%   converted from a similarity to a distance matrix by taking 1-gt.
%
%   References: [1] Yip & Horvath (2007) BMC Bioinformatics 2007, 8:22
%               [2] Ravasz et al (2002) Science 297 (5586), 1551.
%
%   J Goni, University of Navarra and Indiana University, 2009/2011

%#ok<*ASGLU>

%initial state for bm matrix;
bm = adj;

    
function gt = gtom(adj,numSteps)
%GTOM       Generalized topological overlap measure
%
%   gt = gtom(adj,numSteps);
%
%   The m-th step generalized topological overlap measure (GTOM) quantifies
%   the extent to which a pair of nodes have similar m-th step neighbors.
%   Mth-step neighbors are nodes that are reachable by a path of at most
%   length m.
%
%   This function computes the the M x M generalized topological overlap
%   measure (GTOM) matrix for number of steps, numSteps. 
%
%   Inputs:       adj,    adjacency matrix (binary,undirected)
%            numSteps,    number of steps
%
%   Outputs:       gt,    GTOM matrix
%
%   NOTE: When numSteps is equal to 1, GTOM is identical to the topological
%   overlap measure (TOM) from reference [2]. In that case the 'gt' matrix
%   records, for each pair of nodes, the fraction of neighbors the two
%   nodes share in common, where "neighbors" are one step removed. As
%   'numSteps' is increased, neighbors that are furter out are considered.
%   Elements of 'gt' are bounded between 0 and 1.  The 'gt' matrix can be
%   converted from a similarity to a distance matrix by taking 1-gt.
%
%   References: [1] Yip & Horvath (2007) BMC Bioinformatics 2007, 8:22
%               [2] Ravasz et al (2002) Science 297 (5586), 1551.
%
%   J Goni, University of Navarra and Indiana University, 2009/2011

%#ok<*ASGLU>

%initial state for bm matrix;
bm = adj;
bmAux = bm;
numNodes = size(adj,1);

if (numSteps > numNodes)
    disp('warning, reached maximum value for numSteps. numSteps reduced to adj-size')
    numSteps = numNodes;
end