0

What I would like to do in Matlab is to create a vector C with values from a predefined vector A, while the size is determined by B.

F.i.: with A = [2;1;3] and B = [3;2;1], matlab should generate somehow the vector C = [2;2;2;1;1;3] (so 3 times 2 because B(1) = 3 and A(1) = 2, ...).

I wonder if there is an easy way to do this. I was trying something with repmat and kron commands in Matlab, but I can't figure it out.

yarnamc
  • 143
  • 5

0 Answers0