MATLAB - Integral 2 - 第一个输入参数必须是函数句柄

时间:2014-04-13 11:05:20

标签: matlab integral function-handle

我需要使用integral2()函数,语法为:q = integral2(fun, xmin , xmax, ymin , ymax)

我尝试过这些命令:

Alphai(: , 1) = {@(x,y) Alpha(1,1)+Alpha(2,1)*x+Alpha(3,1)*y};
Alphai(: , 2) = {@(x,y) Alpha(1,2)+Alpha(2,2)*x+Alpha(3,2)*y};
Alphai(: , 3) = {@(x,y) Alpha(1,3)+Alpha(2,3)*x+Alpha(3,3)*y};
for ind = 1:3
    temp0 = integral2(Alphai(: , ind), xmin , xmax , ymin , ymax);
end

(已定义xminxmaxyminymax

但我收到了一个错误:

First input argument must be a function handle

有人可以帮助并解释我的错误吗?

1 个答案:

答案 0 :(得分:0)

试试这个:

for ind = 1:3
    temp0 = integral2(Alphai{: , ind}, xmin , xmax , ymin , ymax);
end