Given a directed graph A, the outdegree command computes the sum of edge weights directed out of a vertex i. This is the sum of weights in the i'th row.
A = [[2,4],[5,10]]; outdegree(A,0); 6