简体   繁体   中英

MATLAB - Integral 2 - First input argument must be a function handle

I need to use the integral2() function with syntax: q = integral2(fun, xmin , xmax, ymin , ymax) .

I've tried the commands:

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

(already defined xmin , xmax , ymin , ymax )

But I got an error:

First input argument must be a function handle

Can someone help and explain me what am I doing wrong?

Try this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM