MATLAB: How to use an integral inside another integral

integrationMATLAB

I have the following code:
function [answer]=find_integral2(z)
F=@(y) find_integral(z-y).*find_integral(y);
answer= integral(F,-Inf,Inf);
end
function [answer]=find_integral(u)
F = @(x)normpdf(x).*normpdf(u./x);
answer= integral(F,-Inf,Inf);
end
When I call the function find_integral2(4), I get the following error:
Error using ./ Matrix dimensions must agree.
I know I can solve this with triple integral but I want to call find_integral2 several times, i.e. , I want to again use it in another function:
F=@(y) find_integral(z-y).*find_integral2(y);answer= integral(F,-Inf,Inf);
I would appreciate if you could help me fix this error. Thank you.

Best Answer

Either this (find_integral is unchanged)
function [answer]=find_integral2(z)
F=@(y) arrayfun(@(y)find_integral(z-y).*find_integral(y),y);
answer= integral(F,-Inf,Inf);
end
or this
function [answer]=find_integral2(z)
F=@(y) find_integral(z-y).*find_integral(y);
answer= integral(F,-Inf,Inf,'ArrayValued',true);
end