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: kcoreness_centrality_bu.m
    path of file: ./repos/EEGapp/EEGapp/custom_stuff/BCT/2017_01_15_BCT
    
    the code of the file until where you have to start completion: function  [coreness,kn] = kcoreness_centrality_bu(CIJ)
%KCORENESS_CENTRALITY_BU       K-coreness centrality
%
%   [coreness,kn] = kcoreness_centrality_bu(CIJ)
%

    
function  [coreness,kn] = kcoreness_centrality_bu(CIJ)
%KCORENESS_CENTRALITY_BU       K-coreness centrality
%
%   [coreness,kn] = kcoreness_centrality_bu(CIJ)
%
%   The k-core is the largest subgraph comprising nodes of degree at least
%   k. The coreness of a node is k if the node belongs to the k-core but
%   not to the (k+1)-core. This function computes the coreness of all nodes
%   for a given binary undirected connection matrix.
%
%   input:          CIJ,        connection/adjacency matrix (binary, undirected)
%
%   output:    coreness,        node coreness.
%                    kn,        size of k-core
%
%   References: e.g. Hagmann et al. (2008) PLoS Biology
%
%   Olaf Sporns, Indiana University, 2007/2008/2010/2012

N = size(CIJ,1);

% determine if the network is undirected - if not, compute coreness on the
% corresponding undirected network
CIJund = CIJ+CIJ';
if (any(CIJund(:)>1))
    CIJ = double(CIJund>0);
end