Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: question about gradient function
Date: Mon, 16 Apr 2012 20:14:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <jmhuie$ec8$1@newscl01ah.mathworks.com>
References: <jmhsvs$83f$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1334607246 14728 172.30.248.45 (16 Apr 2012 20:14:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 16 Apr 2012 20:14:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:764772

"arron" wrote in message <jmhsvs$83f$1@newscl01ah.mathworks.com>...
> Hi, just a simple question as I'm confusing myself with vectors on matlab. If I take:
> 
> [dx,dy] = gradient(I);
> 
> are dx and dy vectors? I am looking to compute directional derivatives.....
> 
> Thanks in advance!
- - - - - - - -
  No, with the form you have used, 'I' must be a two-dimensional array and your 'dx' and 'dy' will be the same size.  These are 2nd order (except at the boundaries) approximations to the first partial derivatives with respect to x and to y of the function which 'I' represents in discrete form over the field covered by the grid of 'I'.

Roger Stafford