Nlinfit several response variables

2 views (last 30 days)
Yana
Yana on 10 Mar 2014
Commented: Star Strider on 11 Mar 2014
Hello,
I try to find the best model that would fit three dependent responses, such as v-velocity, u-velocity and temperature. So in the example: beta = nlinfit(X,Y,modelfun,beta0), I would like to have a matrix for Y, which consist of 3 columns. How can I do it?
In modelfun I write how to calculate each variable (buried in Y) using the same parameters beta.
My code is:
coordinates = [x_coord,y_coord];
beta0 = [-144 79 12000 0.2 1.2563];
data = [velocity_x; velocity_y; T_record];
[beta,~,~] = nlinfit(coordinates,data,@model_Rankine,beta0)
How may I make this code to work? Any suggestions would be very helpful.
Thanks, Yana.
  1 Comment
Star Strider
Star Strider on 11 Mar 2014
Your @model_Rankine function has to return values matching the values in data. It has to calculate and return fitted values for [velocity_x; velocity_y; T_record]. Posting it here will help if you are having problems with it. (Please also post a subset of your X and Y data that has at least as many entries as the number of parameters in your model.)
Please also format your code using the [{}Code] button. It makes it easier to read.

Sign in to comment.

Answers (0)

Categories

Find more on Linear Model Identification in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!