How to construct a Row Vector
1 回表示 (過去 30 日間)
古いコメントを表示
M Salman Rashed
2016 年 10 月 14 日
コメント済み: M Salman Rashed
2016 年 10 月 14 日
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!