|
From: | David Bateman |
Subject: | Re: Question about vector function integration |
Date: | Wed, 12 Nov 2008 22:51:47 +0100 |
User-agent: | Mozilla-Thunderbird 2.0.0.17 (X11/20081018) |
Ivan Sutoris wrote:
On Wed, Nov 12, 2008 at 2:05 PM, Corsair <address@hidden> wrote:Hi all. Anyone know how to use `quad' to integrate a vector function?Hi apparently, quad doesn't support vector-valued functions, so you should evaluate your integral for each element of dB separately: intfun1 = @(t) dB(t)(1); intfun2 = @(t) dB(t)(2); intfun3 = @(t) dB(t)(3); [v, ier, nfun, err] = quad(intfun1, 0, 12) [v, ier, nfun, err] = quad(intfun2, 0, 12) [v, ier, nfun, err] = quad(intfun3, 0, 12) Regards Ivan Sutoris
or use "quadv" where the "v" stands for "vector". D. -- David Bateman address@hidden 35 rue Gambetta +33 1 46 04 02 18 (Home) 92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)
[Prev in Thread] | Current Thread | [Next in Thread] |