To understand my problem it would be best if you run this m file:
In the following I refer to the variable names in the file:
It will plot a measured_signal in blue to which I want to fit a function (modeled_signal, shown in red). This function is generated in the same file. However, it is not a simple one line equation (with which all curve fitting tutorials that I found are dealing). It is rather a convolution of two functions one of which is constant and the other contains some variables which I want to optimize.
How can I tell matlab to fit the "modeled_signal" to the "measured_signal" by changing the three variables in lines 9-11 (tmax, alpha, mag)?
Thank you very much for your help!