Error Using fitnlm Function
Mostrar comentarios más antiguos
function regresion_parametros_secador
clc, clear, clear all
TR =[0.422103409 0.42981426 0.437540563 0.445266867 0.45299317 0.460719473 0.468445777 0.47617208 0.483898384 0.491624687 0.499350991 0.507077294 0.514803597 0.522529901 0.530256204 0.537982508 0.545708811 0.553435115 0.561161418 0.568887721 0.576614025 0.592066632 0.607519238 0.622971845 0.638424452 0.653877059 0.669329666 0.684782273 0.70023488 0.715687486 0.731140093 0.7465927 0.762045307 0.777497914 0.792950521 0.808403128 0.823855734 0.839308341 0.854760948 0.870213555 0.885666162 0.901118769 0.916571376 0.932023982 0.947476589 0.962929196 0.978381803 0.99383441 0.99993819];
HFG =[2500.9 2489.1 2477.2 2465.3 2453.5 2441.7 2429.8 2417.9 2406.0 2394.0 2382.0 2369.8 2357.6 2345.4 2333.0 2320.6 2308.0 2295.3 2282.5 2269.5 2256.4 2229.7 2202.1 2173.7 2144.2 2113.7 2081.9 2048.8 2014.2 1977.9 1939.7 1899.7 1857.3 1812.7 1765.4 1715.1 1661.6 1604.4 1543.0 1476.7 1404.6 1325.7 1238.4 1140.1 1027.3 892.7 719.8 443.8 0.0];
modelfun = @(p,HFG) (exp((p(1)+p(2)*(log(1./TR))^0.1+p(3)/TR.^2+p(4)/TR.^3+p(5)/TR.^4)^0.5));
beta0 = [0 53.63746882 0.01601773 0.031311254 0.071298912];
mdl = fitnlm(TR,HFG,modelfun,beta0)
end
%ERROR MESSAGE%
Error using nlinfit (line 205)
Error evaluating model function
'@(p,HFG)(exp((p(1)+p(2)*(log(1./TR))^0.1+p(3)/TR.^2+p(4)/TR.^3+p(5)/TR.^4)^0.5))'.
Error in NonLinearModel/fitter (line 1123)
nlinfit(X,y,F,b0,opts,wtargs{:},errormodelargs{:});
Error in classreg.regr.FitObject/doFit (line 94)
model = fitter(model);
Error in NonLinearModel.fit (line 1430)
model = doFit(model);
Error in fitnlm (line 94)
model = NonLinearModel.fit(X,varargin{:});
Error in regresion_parametros_secador (line 14)
mdl = fitnlm(TR,HFG,modelfun,beta0)
Caused by:
Error using ^
One argument must be a square matrix and the other must be a scalar. Use POWER (.^) for elementwise
power.
>>
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Regression en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!