From: Bruno Luong on
"james bejon" <jamesbejon(a)yahoo.co.uk> wrote in message <hni85h$ddd$1(a)fred.mathworks.com>...
> I'm therefore expecting a (10 x n) output matrix

n = 4;
data=rand(30,n)

indices = repmat((1:10)', 3, 1);
[I J] = ndgrid(indices,1:n);
accumarray([I(:) J(:)],data(:),[10 n])

Bruno
From: Oleg Komarov on
"james bejon"
> I'm therefore expecting a (10 x n) output matrix

I assumed you wanted a 10 by 1 output in my answer.
Try Bruno's solution.

Oleg
From: james bejon on
That's just what I'm after. Thanks very much, Bruno.