I want to solve for b where (the integrands are more complex so that I can't compute the integral myself).

I tried the following

f1=@(x) 1;

f2=@(a,b) integral(f1,0,a+b);

f3=@(b) (integral2(f2,0,b,0,0)-1)^2;

fminunc(f3,0,options);

but I get the error message that A and B must be floating-point scalars.

I appreciate any help. Thanks.

## Best Answer