why i always getting input undefined

1 次查看(过去 30 天)
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:');

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by