Errors in digital notch filter function block .

How do i remove all those errors.? Any fast response really appreciated!
function filter_output = fcn(input_current, sample_instant)
persistent x_t1 y_t1 y_t2 y_t x_t2;
%persistent value are equivalent to the static variable
%initialization of persistent variables to zero value. if isempty(x_t1)
x_t1=0;
end
if isempty(x_t2)
x_t2=0;
end
if isempty(y_t1)
y_t1=0;
end
if isempty(y_t)
y_t=0;
end
if isempty(y_t2)
y_t2=0;
end
if (sample_instant == 0)
y_t = (0.9975*x_t2-1.9911*x_t1+0.9975*input_current-0.9950*y_t2+1.9911*y_t1);
y_t2 = y_t1;
y_t1 = y_t;
x_t2 = x_t1;
x_t1 = input_current;
end
end

Risposte (0)

Categorie

Scopri di più su Modeling in Centro assistenza e File Exchange

Richiesto:

Amy
il 29 Dic 2014

Community Treasure Hunt

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

Start Hunting!

Translated by