Creating Equation from Data
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I'm a relatively new user to Matlab and have hit a roadblock. I'm currently trying to generate an equation with three independent variables (Discharge_prist, Q_prist, Ch_slope) and one dependent variable (Infill_vol), with the dependent variable being a function of the three independent variables. The only function I could find to do this was fitlm (see code below) but I'm not sure if it's the best to use here based on the low confidence that came with the equation it generated from the data. Is there anything else I can use? Thanks!
Also, I do not have permission to attach the data for the 4 variables here so I included a line of code that generated random numbers for each variable. I don't necessarily need the an equation right now that works with the data, just a way to generate one.
discharge_prist=rand(100,1);
q_prist=rand(100,1);
ch_slope=rand(100,1);
infill_vol=rand(100,1);
TBL=table(discharge_prist,q_prist,ch_slope,infill_vol);
mdl=fitlm(TBL,'infill_vol~discharge_prist+q_prist+ch_slope')
3 comentarios
Ameer Hamza
el 21 de Abr. de 2020
Derrick, in nlinfit(), beta0 is just the initial point for the optimization algorithm, and it is not a big issue. You can select it randomly or make an educated guess based on your model or data. The actual issue is, what is the formula for modelfun? You need to have an equation (with unknown parameters) that can relate the input observations to the output data. Then you can use the observed to find the unknown parameters.
Respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!