Effacer les filtres
Effacer les filtres

why i always getting input undefined

3 vues (au cours des 30 derniers jours)
reza kemal
reza kemal le 19 Déc 2016
Commenté : David Barry le 20 Déc 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

Réponses (1)

David Barry
David Barry le 19 Déc 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 commentaires
reza kemal
reza kemal le 20 Déc 2016
thx that was helped me :)
David Barry
David Barry le 20 Déc 2016
Great. Please accept the answer then.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by