数值双积分函数句柄

时间:2014-06-19 23:32:46

标签: matlab double numerical integral

power = 2;


sigma=0.1;

a = 1 /(sigma*sqrt(2*pi));
c= (sigma^2)*2;

syms x y

 f = exp(-(x.^power)./c);

 dfdx = diff(f,x);

 c1 = diff(dfdx,x);



f = exp(-(y.^power)./c);

 dfdy = diff(f,y);

 c2 = diff(dfdy,y);



 meancurvature = (c1 + c2)./ 2;

  gaussiancuravture =(c1 .* c2);



  mean_curv = integral2(meancurvature, -Inf,+Inf, -Inf, +Inf)
  gauss_curv = integral2(gaussiancurvature, -Inf,+Inf, -Inf, +Inf)

我已经用我有限的matlab知识尝试了所有内容,并通过谷歌搜索找到了出现错误的答案:

使用integral2时出错

第一个输入参数必须是函数句柄。

1 个答案:

答案 0 :(得分:0)

您需要为第一个参数传递匿名函数。使用@符号创建它们。有关更多详细信息,请查看这些链接

http://www.mathworks.com/help/matlab/matlab_prog/anonymous-functions.html

Using integral2 in Matlab with vectors