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$>
References: <jmhsvs$83f$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1334607246 14728 (16 Apr 2012 20:14:06 GMT)
NNTP-Posting-Date: Mon, 16 Apr 2012 20:14:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:764772

"arron" wrote in message <jmhsvs$83f$>...
> 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