Path: news.mathworks.com!not-for-mail
From: "Xueou Chen" <hicxo@sina.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to calculate a matrix-based integral
Date: Mon, 19 May 2008 08:28:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 37
Message-ID: <g0rdmi$ko5$1@fred.mathworks.com>
References: <g0j9n6$286$1@fred.mathworks.com> <g0jl2v$mn6$1@fred.mathworks.com>
Reply-To: "Xueou Chen" <hicxo@sina.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 1211185682 21253 172.30.248.35 (19 May 2008 08:28:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 May 2008 08:28:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1388043
Xref: news.mathworks.com comp.soft-sys.matlab:469192


"John D'Errico" <woodchips@rochester.rr.com> wrote in 
message <g0jl2v$mn6$1@fred.mathworks.com>...
> "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

thank you.

I have already tried this way before I posted here. It can 
work anyway. But my integral is from -Inf to +Inf, the 
exact integral range is decided by the precision 
aotomatically. So there is a lot of calculations of my 
integrand function. Then a for loop will slow down my codes 
very much, so I posted here to find a better way.

hicxo