From: A on
> function A = assignarray(A, coords, vals);
> M = accumarray(coords, vals, size(A));
> A(M~=0) = M(M~=0);
>


....which would fail if zero was one of the numbers in vals... I must've taken an extra dose of stupidity pills this morning, never mind.

Anyway, from Bruno's solution, using cell arrays, (reproduced below for convenience), add your own error checking if desired:

function A = assignarray(A, coords, vals);
c = num2cell(coords,1)
A(sub2ind(size(A),c{:})) = vals;