what is the mistake in this code because the output results doesn't appear?

조회 수: 1 (최근 30일)
Sajjad
Sajjad 2022년 10월 4일
편집: per isakson 2022년 10월 10일
how can I make one raw zeros function, I wrote zeros(1,n) but there is an error appeared

답변 (1개)

Angelo Yeo
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
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
Angelo Yeo 2022년 10월 4일
편집: Angelo Yeo 2022년 10월 4일
Thanks Walter for the comment. I changed my answer to be more specific.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by