You would have to write a function which does the same thing. If you want, you can overload it
Place the following in a file @sdpvar/accumarray.m
function A=accumarray(subs,val)
%ACCUMARRAY (overloaded)
A = [];
for i = 1:max(subs)
j = find(i == subs);
if isempty(j)
A = [A;0];
else
% subsref from method fails sometimes due to some weird overloading
% rules in MATLAB, so we jump outside method and do the subsref
% there instead
%A = [A;sum(A(j))];
A = [A;sum(extsubsref(val,j))];
end
end
and the simple case is handled at-least
>> x = sdpvar(1,5);A = accumarray(subs,x);sdisplay(A)
ans =
'x(1)'
'x(2)+x(4)'
'0'
'x(3)+x(5)'
In other words, the for-loops can not be avoided ,it is just a matter of where they are (well, of course the whole thing can be vectorized if performance is wanted since the whole operation can be seen as a matrix-vector multiplication)