Filter löschen
Filter löschen

why i always getting input undefined

3 Ansichten (letzte 30 Tage)
reza kemal
reza kemal am 19 Dez. 2016
Kommentiert: David Barry am 20 Dez. 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

Antworten (1)

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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by