[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: Question about vector function integration

**From**: |
Ivan Sutoris |

**Subject**: |
Re: Question about vector function integration |

**Date**: |
Wed, 12 Nov 2008 22:16:46 +0100 |

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