Path: news.mathworks.com!not-for-mail
From: "Nina " <ninakuklisova@uchicago.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: 3rd derivative function
Date: Thu, 10 May 2012 15:56:13 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <jogoes$pki$1@newscl01ah.mathworks.com>
References: <jogmqk$hqn$1@newscl01ah.mathworks.com> <jognlo$d1u$1@speranza.aioe.org>
Reply-To: "Nina " <ninakuklisova@uchicago.edu>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1336665373 26258 172.30.248.35 (10 May 2012 15:56:13 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 10 May 2012 15:56:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3392200
Xref: news.mathworks.com comp.soft-sys.matlab:767417

Thank you, Nasser!

The full code is this:

h = input ('Type the value of h: ');
x = input ('Type the value of x: ');
h = str2num('h');
x = str2num('x');
if x >=0 
    then f(x) = exp((x));
end
if x <0
    then f(x) = 1/(exp((-x)));
end

f1(x) = (f(x+h)-f(x-h))/(2*h);
f3(x) = (3/(h^3))*(f(x+h)-f(x-h)-2*h*f1(x))

I was thinking it had the necessary values for evaluating the function, but apparently, it still doesn't...