I have a problem with integrating nested function handles in Matlab:
fun = @(x,y) 2*x*y;
y = @(x,a) 5*a*x;
int = integral(@(x)fun(x,y(x,5)),0,2)
The actual nesting goes deeper and the actual functions are more complex but this example pretty much describes my problem which throws 'Error using * Inner matrix dimensions must agree.'