Not enough input arguments for function length()
이전 댓글 표시
I DONT REALLY UNDERSTAND WHAT IS GOING ONE.
I use length([1 2 3]) along it runs well, but by putting into this code it constantly reports errors.
Somebody can explain the situation to me? please!

답변 (1개)
Rik
2020년 11월 18일
You are calling the a4_q3b function without input arguments. You did not give it any value for x, so when you try to use it, your function exits with an error. You are not providing an input to your function, so your function can't provide the input to length. The error has nothing to do with the length function and everything to do with how you call your function.
%this should work better:
a4_q3b([1 2 3],[4 5 6])
Also note that you probably want to use numel instead of length.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!