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