Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to calculate a matrix-based integral
Date: Fri, 16 May 2008 09:45:03 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 20
Message-ID: <g0jl2v$mn6$1@fred.mathworks.com>
References: <g0j9n6$286$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210931103 23270 172.30.248.35 (16 May 2008 09:45:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 May 2008 09:45:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:468786


"Xueou Chen" <hicxo@sina.com> wrote in message 
<g0j9n6$286$1@fred.mathworks.com>...
> I have a matrix-based integrand, i.e., including some 
> matrix calculations, like f(x) = A*B*C, A is a row vector, 
> B a matrix, C a column vector, all associated with x. and 
> f(x) still a single number function of x.
> 
> Now when I use function quadl to calculate int(f(x)), the 
> input x is always a vector, and it tells me error of matrix 
> dimention...

quadl can call your function with multiple
x values all at once. But, Matlab has a for
loop that you can use.

Put one inside your code, to compute your
function for each value of x that is passed
in.

John