function f = funcion_rectangular (t, T) nmuestras = length(t); f = zeros(nmuestras,1); for k=1:nmuestras n = floor(1 + (1/T)*(t(k)-T)); t2 = t(k)-n*T; if t2 >=0 && t2 <= (T/2) f(k) = 1; else f(k) = 0; endif end endfunction