Why this equation cannot be fitted?

10 views (last 30 days)
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!

Accepted Answer

Walter Roberson
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

More Answers (0)

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!