Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to Integrate a matrix using 'dblquad'

조회 수: 1 (최근 30일)
Temesgen Gelaw
Temesgen Gelaw 2015년 6월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
For example, I have tried as the following:
syms x y;
Let u(x,y)= x.*exp(x+y), be the exact function.
fun = inline('x.*exp(x+y)','x','y');
funx = inline('(1+x).*exp(x+y)','x','y');
funy = inline('x.*exp(x+y)','x','y');
UE = feval(fun,x,y);
UEX = feval(funx,x,y);
UEY = feval(funy,x,y);
% function z = integrand(x,y,UEX,UEY,Ax,Ay);
Let A= [ -1.0000 -0.7500 ; -1.0000 -0.7503], be a 2x2 matrix
Let [Ax,Ay] = gradient(A,0.25,0.25), be gradient of A w.r.t 'x' and 'y' and h = 0.25
z = (UEX - Ax).^2 + (UEY - Ay).^2;
Then I use dblquad to integrate 'z' as follows:
Q = dblquad(@(x,y)z,-1,-0.75,-1,-0.75,10^(-6));
where xmin=-1, xmax=-0.75 , ymin = -1, ymax=-0.75.
but the following error occurred.
Error using dblquad>innerintegral (line 79) Inputs must be floats, namely single or double.
Error in quad (line 72) y = f(x, varargin{:});
Error in dblquad (line 58) Q = quadf(@innerintegral, ymin, ymax, tol, trace, intfcn, ...
Is there any one who can help me to integrate a matrix with 'dblquad'?
Thank you for everything !

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by