Why this equation cannot be fitted?
10 views (last 30 days)
Show older comments
Zhaokuan Lu
on 15 Jan 2020
Answered: Walter Roberson
on 15 Jan 2020
I'm trying to fit the function below:
fitfunction = strcat('l*x*z+l*y*z');
myfittype = fittype(fitfunction,...
'dependent',{'f'},'independent',{'x','y','z'},...
'coefficients',{'l'});
However, Matlab wouldn't allow me to creat the fittype. The error message here:
"Expression l*x*z+l*y*z is not a valid MATLAB expression, has non-scalar coefficients, or cannot be evaluated:
Not enough inputs to FITTYPE function."
Does anybody know why this happened? Thanks!
0 Comments
Accepted Answer
Walter Roberson
on 15 Jan 2020
You cannot use 3 or more independent variables.
f = l*(x+y)*z
Implies
f/(z*(x+y)) = l
Which becomes the defining estimate with the understanding that / is the matlab matrix division operation
0 Comments
More Answers (0)
See Also
Categories
Find more on Linear and Nonlinear Regression 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!