what is the mistake in this code because the output results doesn't appear?
조회 수: 1 (최근 30일)
이전 댓글 표시
how can I make one raw zeros function, I wrote zeros(1,n) but there is an error appeared
댓글 수: 0
답변 (1개)
Angelo Yeo
2022년 10월 4일
편집: Angelo Yeo
2022년 10월 4일
In line 180, you are not supposed to use function "zeros" like below.
zeros(j, 1:n)
According to the error message, the second input to "zeros" should be scalar not a vector like "1:n"
댓글 수: 2
Walter Roberson
2022년 10월 4일
편집: Walter Roberson
2022년 10월 4일
You can pass a single numeric parameter that is a vector, such as
zeroes([j, n])
zeroes(size(x))
Angelo Yeo
2022년 10월 4일
편집: Angelo Yeo
2022년 10월 4일
Thanks Walter for the comment. I changed my answer to be more specific.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!