推 geniusturtle:用for包住repmat?? 10/05 20:44
我有一個大概五千個elements的vector
其中每個element要被重複複製一定次數,
eg.
A=[1 2 3 4 5];
B=[1 3 4 1 1];
out=magicFunction(A,B);
out=[1 2 2 2 3 3 3 3 4 5]
也就是說,A的第n個element要被複製B(n)次,我該如何做這個function呢?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 24.182.190.125