I hope following explains better my problem. I am looking for P and σ.
A solution could be to minimize the sum of absolute differences of the given volumes Vin and the calculated volume-parts under the 3D bell shape. The example below is only for three Vin, but more Vin are possible.
Please observe that only the integral limits change with every Vin.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/327551/image.jpeg)
To simplify the problem, the y-limits remain constant.
The integral x-limits are:
xin+-0.5 with xin=0, 1, 2
How can I find P and σ by using nlinfit or lsqcurvefit?