Why this equation cannot be fitted?

10 vues (au cours des 30 derniers jours)
Zhaokuan Lu
Zhaokuan Lu le 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!

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by