function f = serie_rectangular (t, nterm) suma = 0; for k=1:nterm n = 2*k-1; termino = (1/n)*sin(n*pi*t); suma = suma + termino; endfor f = (1/2)+(2/pi)*suma; endfunction