what toolbox do I need to fit an exponential with bounded parameters?
Show older comments
Hi,
I want to fit an exponential function to my data, and force this exponential to be positive and decreasing (i.e. y=a*exp(b*x) with a>0 and b<0).
I figured this is what I need (built using examples from helfile):
fo = fitoptions('Method','LinearLeastSquares',...
'Lower',[0,-Inf],...
'Upper',[Inf,0]);
ft = fittype('a*exp(b*x)','independent','x','coefficients',{'a','b'},'options','fo');
coeffs=fit(data(:,1),data(:,2), 'ft');
However, I get a weird error message while compiling:
To use 'copy', at least one of the following products must be licensed, installed, and enabled:
RF Toolbox
Simulink
Simulink Control Design
Simulink Design Optimization
Stateflow
Error in fittype>iParseParameters (line 567)
obj.fFitoptions = copy( value );
.....
Do I really need additional toolboxes, or is there a wrong syntax in my code that I can't see?
Thanks a lot in advance,
Francois
Accepted Answer
More Answers (2)
Image Analyst
on 16 Nov 2018
0 votes
You do not need Simulink or the Curve Fitting Toolbox. You can use the more common Statistics and Machine Learning Toolbox and use fitnlm (Fit Non Linear Model). I'm attaching a demo.

Francois
on 16 Nov 2018
0 votes
2 Comments
Image Analyst
on 16 Nov 2018
Edited: Image Analyst
on 16 Nov 2018
Not sure who your "Answer" here is talking to...
Or what toolbox you're referring to.
Francois
on 16 Nov 2018
Categories
Find more on Get Started with Curve Fitting Toolbox 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!