Borrar filtros
Borrar filtros

Can you save a cfit object (created programmatically using the 'fit' function) as a .sfit file to be opened in the curve fitting app?

17 visualizaciones (últimos 30 días)
I want to write some code where an inital attempt at curve fitting is done programatically, with an option for a user to open the fit in the curve fitting app which will allow them to play with the fit?
I have been unsucsessfull in using the following syntax as although it does create a .sfit file, that file is not recognised when i attempt to load it into the curve fitting app.
Where DataFit is the object resulting from use of the 'fit' function.
save MyFit.sfit DataFit

Respuesta aceptada

Drew
Drew el 15 de Nov. de 2023
The short answer is "no". As of R2023b, you cannot save a cfit object (created programmatically using the 'fit' function) as a .sfit file to be opened in the curve fitting app.
What you can do, to get closer to the functionality you are looking for, is to use the Curve FItter app launching options shown at https://www.mathworks.com/help/curvefit/curvefitter-app.html
Some use cases to mention:
(1) If the Curve Fitter app is not open,
>> load carsmall
>> curveFitter(Horsepower, MPG)
will launch the Curve Fitter app and create a default fit using the provided x and y data. In the app, you can then change the fit to the desired type. This gets the data into the app from the CLI.
(2) If the Curve Fitter app is already open, then any new call to curveFitter with data arguments
>> curveFitter(Horsepower, MPG, Acceleration)
will switch focus to the Curve Fitter app and will add a fit to the existing in-app Table of Fits, using the provided data (which, in general, could include x, y, z, and w). In the app, you can then change the fit to the desired type. Again, this gets the data into the app from the CLI.
(3) The Curve Fitter app can be launched/opened with any saved Curve Fitter app session.
curveFitter('CurveFitterAppSavedSession.sfit')
This saved Curve Fitter app session could contain particular fits and fit options of interest. New fits with those fit types and fit options can be created in the app by duplicating the fit of interest, and then changing the data selection for that duplicated fit.
In conclusion, while the functionality you are requesting is not currently available, there are some options that partially provide the desired convenience.
If you find this answer helpful, please remember to accept the answer.
  1 comentario
William Renold-Smith
William Renold-Smith el 21 de Nov. de 2023
Thank you for the response, you have helped to some extent. I suspect that for the functionality i'm looking for to work i would need to extract the relevent data from the '.sfit' file using the command line interface.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Fit Postprocessing en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by