how to get a function equation
1 view (last 30 days)
Show older comments
Hello every one I have two sets of data which have nonlinear relationship, it looks like Gaussian distribution according to the figure I got (attached). is there a way that I can input these two of data set in matlab and then get the function (equation associated with the curve)? function seems to be exponential, something like normal distribution function. any help would be appreciated !
2 Comments
John D'Errico
on 14 Apr 2017
Edited: John D'Errico
on 14 Apr 2017
Learn to use tools like the optimization toolbox (thus lsqnonlin or lsqcurvefit), or the curvefitting toolbox, or nlinfit from the stats toolbox. If you lack any of those tools, then get one, since you are trying to solve problems of this class.
Any will suffice. If you don't have them, then download a tool from the File Exchange. I'd suggest fminspleas as a decent choice. (Because I wrote it.) Finally, you will need to learn about modeling, about how to choose a model, how to parameterize that model, about what are starting values and why you often need good starting values.
As far as the model goes, possibly a sum of three Gaussian terms would suffice. On the other hand, a well fit spline could easily be as good a choice of model. Much depends on what you want to do with that model. So knowing your goals is important.
Answers (0)
See Also
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!