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: threshold_absolute.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 W = threshold_absolute(W, thr)
% THRESHOLD_ABSOLUTE    Absolute thresholding
% 
%   W_thr = threshold_absolute(W, thr);
%
%   This function thresholds the connectivity matrix by absolute weight

    
function W = threshold_absolute(W, thr)
% THRESHOLD_ABSOLUTE    Absolute thresholding
% 
%   W_thr = threshold_absolute(W, thr);
%
%   This function thresholds the connectivity matrix by absolute weight
%   magnitude. All weights below the given threshold, and all weights
%   on the main diagonal (self-self connections) are set to 0.
%
%   Inputs: W           weighted or binary connectivity matrix
%           thr         weight treshold
%
%   Output: W_thr       thresholded connectivity matrix
%
%
%   Mika Rubinov, UNSW, 2009-2010

W(1:size(W,1)+1:end