what is the difference between the 2 codes ?
이전 댓글 표시
답변 (1개)
James Tursa
2021년 4월 8일
편집: James Tursa
2021년 4월 8일
0 개 추천
zeros([2,2]) passes one argument, a 2-element vector [2,2].
zeros(2,2) passes two arguments, the scalars 2 and 2.
The result is the same, a 2x2 matrix filled with 0's.
For a square matrix result, you could also have used a single scalar argument and got the same result:
zeros(2)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!