I thought at first that I might be able to beat the vectorized solution above by using the 'choose' function, but I think it must be more or less equivalent to using 'loc'. Actually it is not necessary to construct two explicit (or implicit) indices of the elements of z, perhaps you would call this cheating, but I find that the following code runs around twice as fast.

t0 = time();
posSum = sum(choose(z>0,z,0));
negSum = posSum-sum(abs(z));
tCHOOSE = time() - t0;

So the cost for using loc or choose is large compared to running a simple function like abs() on every element of a matrix.