This is what I have:
myfittype=fittype('a*exp(b*x)cos(c*x)',... 'dependent',{'y'},'independent',{'x'},... 'coefficients',{'a','b','c'})f2=fit(xo,Vox,myfittype)figureplot(f2,xo,Vox)
This is the error I get:
Error using fittype/testCustomModelEvaluation(line 12)Expression a.*exp(b.*x)cos(c.*x) is not a validMATLAB expression, has non-scalar coefficients,or cannot be evaluated:Error in fittype expression ==>a.*exp(b.*x)cos(c.*x)??? Error: Unexpected MATLAB expression.Error in fittype>iCreateFittype (line 371) testCustomModelEvaluation( obj );Error in fittype (line 328) obj = iCreateFittype( obj, varargin{:} );Error in VelocidadE2P2 (line 58)myfittype=fittype('a.*exp(b.*x)cos(c.*x)',...Caused by: Error using fittype/evaluate (line 102) Error in fittype expression ==> a.*exp(b.*x)cos(c.*x) ??? Error: Unexpected MATLAB expression.
Does anyone know? Please help
Best Answer