double integral when using syms

1 次查看(过去 30 天)
syms x y a
w(1)=(x-5)*(y-5)*(x-2.5)*(y-2.5)*(4/625);
w(2)=x*(x-5)*(y-2.5)*(y-5)*(-8/625);
w(3)=x*(x-2.5)*(y-2.5)*(y-5)*(4/625);
w(4)=(x-2.5)*(x-5)*y*(y-5)*(-8/625);
w(5)=x*(x-5)*y*(y-5)*(16/625);
w(6)=x*(x-2.5)*y*(y-5)*(-8/625);
w(7)=(x-2.5)*(x-5)*(y-2.5)*y*(4/625);
w(8)=x*(x-5)*(y-2.5)*y*(-8/625);
w(9)=x*(x-2.5)*(y-2.5)*y*(4/625);
for i=1:2
for j=1:2
m=diff(w(i),x);
n=diff(w(j),x);
o=diff(w(i),y);
p=diff(w(j),y);
a(x,y)=m.*n+o.*p;
fun=@(x,y)a(x,y)
k(i,j)=integral2(fun,0,5,0,5);
end
end
k
This is the code I am trying to run and I am getting an error "Input function must return 'double' or 'single' values. Found 'sym'." .. Any idea if this can be fixed? If not.. how do I evaluate the double integral?

采纳的回答

Walter Roberson
Walter Roberson 2012-11-25
Use int() for symbolic integration.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by