function y = bdot(u, g1, g2) % This block supports an embeddable subset of the MATLAB language. % See the help menu for details. persistent h; persistent cont; persistent u_old; k = 0; if isempty(h) h = 0; cont = 0; u_old = 0; end %u = u; switch h case 0 cont = g2*(u-u_old + g1*cont); u_old = u; k = cont; h = h+1; case 9 h = 0; otherwise k = cont; h = h +1; end y = k;