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: strengths_und_sign.m
    path of file: ./repos/EEGapp/EEGapp/custom_stuff
    
    the code of the file until where you have to start completion: function [Spos Sneg vpos vneg] = strengths_und_sign(W)

%STRENGTHS_UND_SIGN        Strength and weight

%

    
function [Spos Sneg vpos vneg] = strengths_und_sign(W)

%STRENGTHS_UND_SIGN        Strength and weight

%

%   [Spos Sneg] = strengths_und_sign(W);

%   [Spos Sneg vpos vneg] = strengths_und_sign(W);

%

%   Node strength is the sum of weights of links connected to the node.

%

%   Inputs:     W,              undirected connection matrix with positive

%                               and negative weights

%

%   Output:     Spos/Sneg,      nodal strength of positive/negative weights

%               vpos/vneg,      total positive/negative weight

%

%

%   2011, Mika Rubinov, UNSW



%   Modification History:

%   Mar 2011: Original





n = length(W);              %number of nodes

W(1:n+1:end