1: input a number or string from the keyboard

clear all;
close all;

x0 = input('Get a point value:\n');
h = input('Get the sapcing size:\n');
method = input('Get the formula you want to use: two point or three point\n','s');

f0 = func_41(x0);
f_f1 = func_41(x0+h);
f_b1 = func_41(x0-h);
f_f2 = func_41(x0+2*h);

if (strcmp(method,'two point'))
f_derivative = 1/(2*h)*(f_f1-f_b1);
elseif (strcmp(method,'three point'))
f_derivative = 1/(2*h)*(-3*f0+4*f_f1-f_f2);
end

"func_41.m"

function f = func_41(x);
f = x.*exp(x);


