Integrating the eigenvalues of a matrix...

2 次查看(过去 30 天)
Hi people,
The simplified version of problem is the following.
I have a complicated matrix function f(x,y). The integrand of my problem is a function of the eigen system of f(x,y). Suppose
[s,t]=eig(f(x,y));
The integrand is, for example, g(x,y)=2*s(1,2)*t(1,1), so the integration goes as
dblquad(g,-1,1,-1,1)
which cannot be carried out.
The problem is that, the quad routine converts x and y into an array of values, which are the sampling points of the routine. The command [s,t]=eig(f(x,y)) cannot be carried out, as x and y are now arrays, and the matrix function f(x,y) are no longer well defined.
So how should I proceed? Thank you a lot.
  1 个评论
w
w 2012-1-15
I tried to express the integrand using the command
integrnd1=@(xp,yp)arrayfun(@(x,y)2*s*t,xp,yp);
When xp and yp are arrays of the same size, integrnd1(xp,yp) manages to yield the correct results.
However, when I tried to integrate it, the following message appears:
??? Error using ==> arrayfun
All of the input arguments must be of the same size and shape.
Previous inputs had size 13 in dimension 2. Input #3 has size 1.
Not sure what it means...

请先登录,再进行评论。

采纳的回答

w
w 2012-1-16
It turns out that all I had to do was, instead of using dblquad, to integrate x and y separately. The command integrnd1=@(xp,yp)arrayfun(@(x,y)2*s*t,xp,yp); should be separated into two parts, too: one for x, the other for y.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by