How do I repeat different numbers in a row?
显示 更早的评论
I need to find a more concise way of repeating different numbers, each a different number of times in a row.
My current row (1x45 matrix) contains 15 8 times, 4 10 times, 5 8 times, 12 6 times, 4 6 times, 5 3 times and 12 4 times
i.e. my current matrix looks like:
A = [15 15 15 15 15 15 15 15 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 12 12 12 12 12 12 4 4 4 4 4 4 5 5 5 12 12 12 12]
Is there a more concise way I can code this data to produce this matrix?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!