Here is my code;
function z = joy(t,z)joymin = @(x) 150 - x;joyadd = @(z) z;z = integral2(@(x,y) normpdf(x,100,10).*normpdf(y,200,10),t,inf,joymin + joyadd,inf);end
When I try to run joy(100,10), I get an error saying Undefined operator '+' for input arguments of type 'function_handle'.
The problem comes from joyadd because the code runs smoothly if I remove it.
Best Answer