Borrar filtros
Borrar filtros

why i always getting input undefined

3 visualizaciones (últimos 30 días)
reza kemal
reza kemal el 19 de Dic. de 2016
Comentada: David Barry el 20 de Dic. de 2016
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

Respuestas (1)

David Barry
David Barry el 19 de Dic. de 2016
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 comentarios
reza kemal
reza kemal el 20 de Dic. de 2016
thx that was helped me :)
David Barry
David Barry el 20 de Dic. de 2016
Great. Please accept the answer then.

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by