Path: news.mathworks.com!not-for-mail
From: "Andrew" <joeblow@aol.com>
Newsgroups: comp.soft-sys.matlab
Subject: A stupid question about divergence and curl
Date: Thu, 2 Apr 2009 04:52:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <gr1g9h$hba$1@fred.mathworks.com>
Reply-To: "Andrew" <joeblow@aol.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1238647921 17770 172.30.248.37 (2 Apr 2009 04:52:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 2 Apr 2009 04:52:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 894530
Xref: news.mathworks.com comp.soft-sys.matlab:529587

The documentation about divergence and curl is unclear (to me) about what values, and even functions, these operations are evaluated at. For example when I use this code:

x=-3:.1:3;y=-3:.1:3;
z=exp(-(x.^2+y.^2));
[X Y]=meshgrid(x.*z,y.*z);
[U V]=randn(61,61);
div=divergence[X,Y,U,V]

I get a set of values for the variable "div" that I assume is the divergence of something, but I can't tell what. Then, I change the values of U and V to:

[U V]=meshgrid(x,y);
div=divergence[X,Y,U,V]

I get a different set of values. However, neither of these evaluates the divergence of the vector function [X Y] at the point indicated in [U V]. Is not this what this command is supposed to do? Does anybody know the proper syntax?

Thank You for Responding:

Andrew Stallard