<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169370</link>
    <title>MATLAB Central Newsreader - How to calculate a matrix-based integral</title>
    <description>Feed for thread: How to calculate a matrix-based integral</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 16 May 2008 06:31:02 -0400</pubDate>
      <title>How to calculate a matrix-based integral</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169370#432426</link>
      <author>Xueou Chen</author>
      <description>I have a matrix-based integrand, i.e., including some &lt;br&gt;
matrix calculations, like f(x) = A*B*C, A is a row vector, &lt;br&gt;
B a matrix, C a column vector, all associated with x. and &lt;br&gt;
f(x) still a single number function of x.&lt;br&gt;
&lt;br&gt;
Now when I use function quadl to calculate int(f(x)), the &lt;br&gt;
input x is always a vector, and it tells me error of matrix &lt;br&gt;
dimention...&lt;br&gt;
&lt;br&gt;
I have to calculate the above matrix formulas on paper to &lt;br&gt;
avoid such errors. But f(x) actually includes matrix &lt;br&gt;
inversion. 3 * 3 is still ok, then 4 * 4 matrix ... very &lt;br&gt;
boring.&lt;br&gt;
&lt;br&gt;
I think there are some other ways to do this better.&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 16 May 2008 09:45:03 -0400</pubDate>
      <title>Re: How to calculate a matrix-based integral</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169370#432440</link>
      <author>John D'Errico</author>
      <description>"Xueou Chen" &amp;lt;hicxo@sina.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0j9n6$286$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a matrix-based integrand, i.e., including some &lt;br&gt;
&amp;gt; matrix calculations, like f(x) = A*B*C, A is a row vector, &lt;br&gt;
&amp;gt; B a matrix, C a column vector, all associated with x. and &lt;br&gt;
&amp;gt; f(x) still a single number function of x.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Now when I use function quadl to calculate int(f(x)), the &lt;br&gt;
&amp;gt; input x is always a vector, and it tells me error of matrix &lt;br&gt;
&amp;gt; dimention...&lt;br&gt;
&lt;br&gt;
quadl can call your function with multiple&lt;br&gt;
x values all at once. But, Matlab has a for&lt;br&gt;
loop that you can use.&lt;br&gt;
&lt;br&gt;
Put one inside your code, to compute your&lt;br&gt;
function for each value of x that is passed&lt;br&gt;
in.&lt;br&gt;
&lt;br&gt;
John&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 19 May 2008 08:28:02 -0400</pubDate>
      <title>Re: How to calculate a matrix-based integral</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169370#432846</link>
      <author>Xueou Chen</author>
      <description>"John D'Errico" &amp;lt;woodchips@rochester.rr.com&amp;gt; wrote in &lt;br&gt;
message &amp;lt;g0jl2v$mn6$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "Xueou Chen" &amp;lt;hicxo@sina.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &amp;lt;g0j9n6$286$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have a matrix-based integrand, i.e., including some &lt;br&gt;
&amp;gt; &amp;gt; matrix calculations, like f(x) = A*B*C, A is a row &lt;br&gt;
vector, &lt;br&gt;
&amp;gt; &amp;gt; B a matrix, C a column vector, all associated with x. &lt;br&gt;
and &lt;br&gt;
&amp;gt; &amp;gt; f(x) still a single number function of x.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Now when I use function quadl to calculate int(f(x)), &lt;br&gt;
the &lt;br&gt;
&amp;gt; &amp;gt; input x is always a vector, and it tells me error of &lt;br&gt;
matrix &lt;br&gt;
&amp;gt; &amp;gt; dimention...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; quadl can call your function with multiple&lt;br&gt;
&amp;gt; x values all at once. But, Matlab has a for&lt;br&gt;
&amp;gt; loop that you can use.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Put one inside your code, to compute your&lt;br&gt;
&amp;gt; function for each value of x that is passed&lt;br&gt;
&amp;gt; in.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; John&lt;br&gt;
&lt;br&gt;
thank you.&lt;br&gt;
&lt;br&gt;
I have already tried this way before I posted here. It can &lt;br&gt;
work anyway. But my integral is from -Inf to +Inf, the &lt;br&gt;
exact integral range is decided by the precision &lt;br&gt;
aotomatically. So there is a lot of calculations of my &lt;br&gt;
integrand function. Then a for loop will slow down my codes &lt;br&gt;
very much, so I posted here to find a better way.&lt;br&gt;
&lt;br&gt;
hicxo&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 19 May 2008 09:54:01 -0400</pubDate>
      <title>Re: How to calculate a matrix-based integral</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/169370#432866</link>
      <author>John D'Errico</author>
      <description>"Xueou Chen" &amp;lt;hicxo@sina.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;g0rdmi$ko5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&lt;br&gt;
&amp;gt; I have already tried this way before I posted here. It can &lt;br&gt;
&amp;gt; work anyway. But my integral is from -Inf to +Inf, the &lt;br&gt;
&amp;gt; exact integral range is decided by the precision &lt;br&gt;
&amp;gt; aotomatically. So there is a lot of calculations of my &lt;br&gt;
&amp;gt; integrand function. Then a for loop will slow down my codes &lt;br&gt;
&amp;gt; very much, so I posted here to find a better way.&lt;br&gt;
&lt;br&gt;
If your integrand is such that you will&lt;br&gt;
define different finite limits based on&lt;br&gt;
your parameters, then this is impossible&lt;br&gt;
to accomplish using quadl. Quadl is an&lt;br&gt;
adaptive quadrature, but it uses only&lt;br&gt;
one set of limits.&lt;br&gt;
&lt;br&gt;
A for loop, external to the quadrature,&lt;br&gt;
is then the solution.&lt;br&gt;
&lt;br&gt;
John&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
