integralN error with function handles as integration limits
Show older comments
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)
Answers (1)
Mike Hosea
5 minutes ago
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
Categories
Find more on Mathematics and Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!