MATLAB: Integrating the eigenvalues of a matrix…

eigensystemMATLABmatrix manipulationnumerical integration

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.

Best Answer

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.
Related Question