Path: news.mathworks.com!not-for-mail
From: "A " <amutka@welho.com>
Newsgroups: comp.soft-sys.matlab
Subject: A few questions about using matlab
Date: Sun, 4 May 2008 11:22:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <fvk68r$mct$1@fred.mathworks.com>
Reply-To: "A " <amutka@welho.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1209900123 22941 172.30.248.35 (4 May 2008 11:22:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 4 May 2008 11:22:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1196300
Xref: news.mathworks.com comp.soft-sys.matlab:466497


Hi,

I'm trying to write and m-file and I'm having a few problems.

1. How do I use a given value of x in functions?

Example, my function is fun(f,x). I input fun(ln(x),2) and
it only gives me the derivative with the x, 1/x. I want the
output to give me the derivative with the 2, 0.5.

This is how it looks like now:

Function out = fun(f,x)

out = diff(f,x);

2. Do any of you have any idea what function would calculate
the equation of the tangent for the given function f with a
given dot x?