I'm new to Matlab

2 views (last 30 days)
Seun Awonusi
Seun Awonusi on 17 Sep 2015
Commented: Star Strider on 17 Sep 2015
Can anyone guide me on the proper code to use for the regression of my data with five(5) independent variables, fit the curve and the right tool to use?

Answers (1)

Star Strider
Star Strider on 17 Sep 2015
Is it a linear or nonlinear regression? If nonlinear, what model do you want to fit?
For a linear regression, and if you have the Statistics Toolbox, the regress function is likely the best place to begin. Otherwise, you can always use mldivide,\, but it won’t give you any statistics on the fit.
  2 Comments
Star Strider
Star Strider on 17 Sep 2015
Seun Awonusi’s ‘Answer’
A nonlinear regression flow model with liquid density, gas density, liquid and gas flow rates and depth as inputs while pressure gradient is my response. Need the right tool and Matlab codes.
Star Strider
Star Strider on 17 Sep 2015
The tools are the Statistics Toolbox function nlinfit or the Optimization Toolbox function lsqcurvefit. (There are also Curve Fitting Toolbox functions, but I don’t have that Toolbox so I can’t provide help with it.)
You have to write the nonlinear regression function code for your model for any of those functions. (We won’t do it for you.) We can help you if you have problems getting it to run. (List or attach the relevant parts of your code, and attach a representative sample of your data, preferably as a .mat file. Include a full description of what you want your code to do, and all the red Command Window output of any errors that your code throws.)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!