Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Is it possible to create a vector with a specified number of ones? eg . V=[ 1 1 1 1 0 0 0 0 0 0 0 0]
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to generate a vector with specified number of ones in it? Using for loop ,is it possible to generate it?
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2016 年 3 月 29 日
編集済み: Azzi Abdelmalek
2016 年 3 月 29 日
َََََA=zeros(1,12)
A(1:4)=1
Or
A=[ones(1,4) zeros(1,8)]
1 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!