Use the curvefitting toolbox. Or the optimization toolbox. Or the stats toolbox. Take your pick. Or you can use fminsearch, or one of MANY tools on the file exchange.
There are MANY examples in those toolboxes of how to do a curve fit. (especially the curvefitting toolbox.) READ THE EXAMPLES.