フィルターのクリア

Integrating the eigenvalues of a matrix...

2 ビュー (過去 30 日間)
w
w 2012 年 1 月 15 日
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 Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by