Integrate curve fitting toolbox in .m-File
10 views (last 30 days)
Show older comments
Hello everybody,
I have several different text files with data sets. All are looking the same, just the values in the cells differ. Now I have to find an equation which fits to the data set. After that I need to do some further math on this equation. And due to the fact that I have around 20 text files I would like to write a script which does all this automatically. At first I tried the "polyfit" method in my script. That worked pretty well and I was also able to integrate this into my "automatic" script. But the past few days I played with the curve fitting toolbox. And the results were way better. The only problem is, I have to start the toolbox by hand, do the selection of the data and the type of equation by hand and need to save the fitted curve manually to the workspace to do the further math. Now I would like to know, if it is possible to write a code which starts the Toolbox automatically, does the fitting, saves the fitted curve and continues with the further math.
I hope my explanation sounds not that weird and you guys are able to help me!
Cheers
Jan
2 Comments
Adam
on 23 Jan 2017
Edited: Adam
on 23 Jan 2017
I don't have the curve fitting toolbox, but, in the nature of a toolbox, it contains many functions that do things 'automatically'. You haven't said what you are actually using. Even if you are using a GUI-based curve fitting program this can be launched programmatically like anything else, but it is hard to advise with no information as to what you are using.
Accepted Answer
Jan
on 23 Jan 2017
If working with the curve fitting toolbox is possibloe, you can be sure, that this would be explained in the documentation. Therefore reading the docs is the best strategy: https://www.mathworks.com/products/curvefitting/features.html#working-with-curve-fitting-toolbox . Under "Working at the Command Line" you find examples of how to call the tools for fitting automatically. There are many examples also.
More Answers (0)
See Also
Categories
Find more on Curve Fitting Toolbox 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!