why i always getting input undefined

조회 수: 1 (최근 30일)
reza kemal
reza kemal 2016년 12월 19일
댓글: David Barry 2016년 12월 20일
i had code my code like this
a1 = input(1);
b0 = input(2);
a2 = input(3);
b1 = input(4);
d = input(5);
% check inputs
if (d<1)
disp('ba2.m: Input parameter d (dead time) must be greater or equal 1');
disp(' parameter value has been changed to 1');
d = 1;
else
d = round(d);
end;
if (b0==0)
b0 = b1;
b1 = 0;
d = d+1;
end;
d = max([round(d)],1);
%compute the controller parameters
gama = b1/b0;
if ((gama <= 0) | (gama == 1))
ki = 1/(2*d-1);
%use serial filter 1/(1 + gama*z^-1)
p1 = -1+gama;
p2 = -gama;
else %gama>0
ki = 1/(2*d*(1+gama)*(1-gama));
p1 = -1;
p2 = 0;
end;
q0=ki/b0;
q1=q0*a1;
q2=q0*a2;
qp=[q0; q1; q2; p1; p2];
and always getting error
??? Input argument "input" is undefined.
Error in ==> ba2 at 31
a1 = input;
please can anyone give me idea about this thx

답변 (1개)

David Barry
David Barry 2016년 12월 19일
It's because you are not using the input function correctly. Either that or you didn't realise input is a MATLAB function, in which case you should rename your variable.
a1 = input('Please enter your input for a1:');
  댓글 수: 2
reza kemal
reza kemal 2016년 12월 20일
thx that was helped me :)
David Barry
David Barry 2016년 12월 20일
Great. Please accept the answer then.

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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by