Integrate curve fitting toolbox in .m-File

7 ビュー (過去 30 日間)
Christian
Christian 2017 年 1 月 23 日
編集済み: Christian 2017 年 3 月 27 日
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 件のコメント
Adam
Adam 2017 年 1 月 23 日
編集済み: Adam 2017 年 1 月 23 日
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.
Christian
Christian 2017 年 1 月 23 日
編集済み: Christian 2017 年 3 月 27 日
Hey Adam!
Let me try to provide you as much information as you need: I am using Matlab 2016. There is a toolstrip named "Apps".
Currently I have to do this: Run my script to get all the data into the workspace
Open the Toolbox and select the x and y values and set a fitting method.
Save the fitted curve in my script
run the script again to do the further math on the fitted curve.
My goal is to write a script where I only have to press run, select the text File and wait till it has finished.

サインインしてコメントする。

採用された回答

Jan
Jan 2017 年 1 月 23 日
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.
  1 件のコメント
Christian
Christian 2017 年 1 月 23 日
Shame on me! I thought that might be such an exotic issue which I won't find in the documentary! But I found exactly what I was looking for in the doc of the Curve Fit App!
Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by