Repeating elements in a vector
1 次查看(过去 30 天)
显示 更早的评论
Hi, i want my following vector:
A = [0,1; 1; 5; 10; 20]
to be
A = [0,1; 1; 5; 10; 20;0,1; 1; 5; 10; 20;0,1; 1; 5; 10; 20; ... ]
(50 times repeated)
0 个评论
采纳的回答
更多回答(1 个)
William Rose
2023-10-20
A = [0,1; 1; 5; 10; 20]
is not valid because it uses a comma as well as semicolons. I assume you meant to write
A = [0; 1; 1; 5; 10; 20];
Then do
A=repmat(A,50,1);
Check:
size(A)
OK.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!