필터 지우기
필터 지우기

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 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