From: "Andrew" <>
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$>
Reply-To: "Andrew" <>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1238647921 17770 (2 Apr 2009 04:52:01 GMT)
NNTP-Posting-Date: Thu, 2 Apr 2009 04:52:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 894530
Xref: 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 Y]=meshgrid(x.*z,y.*z);
[U V]=randn(61,61);

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);

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