Not enough input arguments help needed for assignment

function distance = dis(W)
d=0.1; k=1e4; k2=1.5e4;
if (W/k)<d
x=W/k1
else
x=(W+2*k2*d)/(k+2*k2)
end
end
Error in dis (line 6)
if (W/k<d)

답변 (1개)

Guillaume
Guillaume 2016년 5월 27일
Well, the error is fairly clear. You haven't supplied the one argument required by your function.
You need to call dis like:
distance = dis(12345); %replace 12345 by actual value
or
somevar = 12345;
distance = dis(somevar);

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2016년 5월 27일

답변:

2016년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by