Fitting Data to a Model
Although we frequently need to fit our data to a model, its a little tricky to get right in MATLAB. I wrote a brief code example to get you started.
My code example is self-contained and illustrates how one might fit the MSD curves for a diffusing molecule.
1. Code
Section titled “1. Code”- Code: fit_data_to_model.m
- In addition, check out the fminsearchbnd function on the MATLAB Central File Exchange.