ADG
unread,Nov 20, 2008, 4:46:39 PM11/20/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to The MATLAB users
Hello everyone,
I am trying to replicate rows in a matrix as follows.
Base matrix, A = [0 0;0 1;1 1]
Another array specifies the multiples by which each row needs to
replicate.
Rep = [2 3 1]
Now, I am trying to look for some kind of expression that would lead
to the following answer:
OPERATION(A,Rep) ------> [0 0;0 0;0 1;0 1;0 1;1 1]
As shown in the example, each row is duplicated by the factor present
in the Rep array. Also, I am trying to perform this without using a
loop. Is this possible to do in matlab? I do not have a problem using
new data structures while achieving this. My only concern is to
achieve this without using a loop and repmat does not let you do this
operation.
Any/all response(s) is/are greatly appreciated!