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!