Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to Integrate a matrix using 'dblquad'

1 Ansicht (letzte 30 Tage)
Temesgen Gelaw
Temesgen Gelaw am 3 Jun. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 !

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by