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개)

Mike Hosea
Mike Hosea 대략 5시간 전
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

태그

질문:

2020년 10월 26일

답변:

2026년 7월 13일 3:32

Community Treasure Hunt

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

Start Hunting!

Translated by