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)

Respuestas (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

Categorías

Más información sobre Mathematics and Optimization en Centro de ayuda y File Exchange.

Productos

Versión

R2020a

Etiquetas

Preguntada:

el 26 de Oct. de 2020

Respondida:

el 13 de Jul. de 2026 a las 3:32

Community Treasure Hunt

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

Start Hunting!

Translated by