Fitting 3D data into a function

21 vues (au cours des 30 derniers jours)
Nikola Ristic
Nikola Ristic le 15 Mai 2023
I have some data that I want to fit in a function. To be more clear, the data points depend on time, as well as the the radial and longitudinal coordinate. I would like to fit these data points into a function of the form f(r, z, t). I know I can fit data into a surface using fitobject = fit([x,y],z,fitType). However, I need a function in the form of fitobject = fit([x,y,z],f,fitType). Is there such a thing in Matlab? I failed to find it. Preferably, I would like to fit it into a polynomial.

Réponse acceptée

John D'Errico
John D'Errico le 15 Mai 2023
The curve fitting toolbox does not fit models with more than 2 independent variables.
You can use my polyfitn tool, found on the file exchange, to fit a polynomial model in multiple dimensions.

Plus de réponses (1)

Image Analyst
Image Analyst le 15 Mai 2023
Have you tried the Regression Learner app on the apps tab of the tool ribbon? You give it a set of input predictors, and a set of ground truth response values (the "true" values that you are going to train the model with) and then you can test a wide variety of models with it. You can choose the best model, which might or might not be a polynomial, and you might not have an analytical function/formula to write down, but that should not matter. All that matters is if you put in a set of predictors, you get a reasonable estimate for what the "true" value should be.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

Catégories

En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by