function y=g(x)
y=(x^2-exp(x))/5;
endfunction
function x=puntofijo(x0,tol)
i=1;
ea(1)=100;
x(1)=x0;
while abs(ea(i))>=tol,
x(i+1) = g(x(i));
ea(i+1) = abs((x(i+1)-x(i))/x(i+1))*100;
i=i+1;
end
printf(' i \t X(i) Error aprox (i) \n');
for j=1:i;
printf('%2d \t %11.7f \t %7.3f \n',j-1,x(j),ea(j));
end
endfunction

Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Gracias por tu aporte, recordar agregar última linea de código
Ejemplo:
x=puntofijo(0.5,0.001)
exacto yo tengo el mismo problema que balla quiero ver uno con entrada (x0,tol,n) donde n es el numero de iteracion.
buenas tardes serà me pueden hacer otro pero con un numero especifico de iteraciones..que no sea infinito
este método no funciona?