Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
How to Integrate a matrix using 'dblquad'
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!