You are on page 1of 1

function[]=euler

y=input('Ingrese la funcion Y:','s');


a=input('Ingrese el valor inicial de X:');
b=input('Ingrese el valor final de X:');
h=input('Ingrese el valor de H:');
Y=input('Ingrese el primer valor de Y(0):');
disp('*********************************');
g=inline(y);
disp('Los valores de Y1:');
for x=a:h:b
y2=feval(g,x,Y);
y1=Y+(y2*h);
Y=y1;
disp(y1);
plot(x,y1,'*');grid on;hold on;title('CURVA DE LA FUNCION');
end

You might also like