integralN error with function handles as integration limits

Hi There,
i am trying to solve a 4 fold integral using integralN.m. As soon as i use function handles as integration limits i get the error message:
""""
Error using Untitled>@(v)-sqrt(1.27.^2-v.^2)
Too many input arguments.
""""
wich originates from the execution of the inner integral2-call, according to my findings using the debugger.
How can i use the integralN function with function handles as limits correctly?
Regards
Alex
d = 200;
a = @(x, y, v, w) (cos(atan(sqrt((x-v).^2 + (y-w).^2)./d)).^4)./(d.^2);
xmin=-5;
xmax=5;
ymin=@(x)-sqrt(5.^2-x.^2);
ymax=@(x)sqrt(5.^2-x.^2);
vmin=-1.27;
vmax=1.27;
wmin=@(v)-sqrt(1.27.^2-v.^2);
wmax=@(v)sqrt(1.27.^2-v.^2);
integralN(a, xmin, xmax, ymin, ymax, vmin, vmax,wmin, wmax)

回答(1 个)

The wmin and wmax arguments must be a function of x, y, and v, even if x and y are ignored.
>> wmin=@(x,y,v)-sqrt(1.27.^2-v.^2);
>> wmax=@(x,y,v)sqrt(1.27.^2-v.^2);
>> integralN(a, xmin, xmax, ymin, ymax, vmin, vmax,wmin, wmax)
ans =
0.0099

类别

帮助中心File Exchange 中查找有关 Mathematics and Optimization 的更多信息

产品

版本

R2020a

标签

Community Treasure Hunt

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

Start Hunting!

Translated by