curve fitting toolbox code
古いコメントを表示
Hi everybody
I fitted my curve which goes over these two points(0,0) and(1,1) in matlab fitting toolbox, i want to extract what will be the y if x=2 in m.file.
How to convert toolbox to code and create function in which when I import x=2 it shows y=2 .
I don't know why the generation code is a function of x & y not only x.
Can anybody help me?
thanks
3 件のコメント
dpb
2021 年 1 月 18 日
You save the fit object and then simply call it with the input variables as a function.
See the documentation for all the details; you'll probably find the "Postprocessing" part of most use for these questions once have a model.
saeed
2021 年 1 月 19 日
dpb
2021 年 1 月 19 日
You have to somehow get the fit object into the correct context; functions have their own context and so a new function doesn't know anything about the model you saved into the workspace.
Three basic options --
- If you have the data available, build the model from the data in the function having used the fit tool to find the class of model that is satisfactory, or;
- SAVE the fit object you created in the fit tool to a .mat file and load it back within the function, or
- pass the object to the function from a context in which it does exist.
The tool can also build an m-file which will regenerate the model but it also either must read in the data again or have it stored internally.
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Get Started with Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!