The right solution of par (1) and y must be a 0.965.
Why do you speak of y as if it is an unknown? The unknown parameters are supposed to be the vector elements par(i). Also. your model fun(par,y) doesn't look right for several reasons,
- The integrand passed to integral() is not a function handle
- You have 2 unknowns in x0, but only 1 unknown in par
- You've written it in terms of par and y instead of par and x
Also note that if the integrand is intended to be a par-dependent constant, you can do the integral analytically. You don't need the integral() coommand.