|
The think which is crossing my mind right now includes a damm loop.
C=[];
for i = 1 : length(B)
C=[C;repmat(A(i,:),B(i),1)];
end
-JJ-
"Hans-Peter Suter" <chappi@freesurf.ch> wrote in message
news:eeb758b.-1@WebX.raydaftYaTP...
> Good morning,
>
>
> Is there some smart way to repeat the rows of a matrix according to a
> second vector that indicates how many times each row has to be
> copied. For example with A = [1990 5;1991 6] and B = [1 2]' I would
> get
> C = [1990 5;1991 6; 1991 6]
>
>
> Thank you for any ideas
> Hans-Peter
|