How to construct a Row Vector
1 次查看(过去 30 天)
显示 更早的评论
I want to construct a row vector, with say, "L zeros", followed by a "1", and then again followed by "L Zeros"
What is the easiest command to do that? For example a= [ (0 0 0 ... L-1(0)) 1 (0 0 0 ... (L-1) 0)]
0 个评论
采纳的回答
Andrei Bobrov
2016-10-14
编辑:Andrei Bobrov
2016-10-14
L = 5; % or L = 1000
out = [zeros(1,L),1,zeros(1,L)];
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operators and Elementary Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!