Combining two arrays by pointwise repeating the elements of A(i), B(i) times.
2 次查看(过去 30 天)
显示 更早的评论
I want to combine two vectors (A and B) with the same length into a new vector (C) with length sum of B.
e.g.
A = [1,2,3,4]; B = [2,1,2,3];
C = [1,1,2,3,3,4,4,4]
Thus repeating the elements of A, B times.
0 个评论
回答(2 个)
Pierre Benoit
2014-10-9
You can use this function from the FEX : http://www.mathworks.com/matlabcentral/fileexchange/6436-rude-a-pedestrian-run-length-decoder-encoder/content/rude.m
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!