Fitting 3D data into a function

13 次查看(过去 30 天)
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.

采纳的回答

John D'Errico
John D'Errico 2023-5-15
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.

更多回答(1 个)

Image Analyst
Image Analyst 2023-5-15
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:

类别

Help CenterFile Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by