what does x= [ones(1,2) 2 ones(1,1) 2 ones(1,2) 1] do?
4 ビュー (過去 30 日間)
古いコメントを表示
採用された回答
KSSV
2019 年 5 月 8 日
It depends on the requirement of what array you want. If you see that line generates:
[1 1 2 1 2 1 1 1]
The array has 2 in 3rd, 4th position. So 2 is used. The same can also be generated using:
X = ones(1,8) ;
X([3 5]) = 2
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!