vecs[[j, all]] should translate to vecs(j,:) or vecs(:,j). the semi-colon tells MATLAB to select all of the elements in that dimension (j,:) being everything in the jth row, and (:,j) being everything in the jth column.
So something like
sum = [];
for j = 1:10
sum = sum + sqrt(vals(j) .*...