MATLAB: What toolbox do I need to fit an exponential with bounded parameters

curve fittingMATLABtoolbox

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

Best Answer

Ho thanks! Sorry I am new to Matlab and tend to get confused over what should be a string and what should not.
I finally managed now, actually skipping the whole fittype call and putting the fitoption as an argument to the fit function directly. I do not think this construction is very well explained in the help file...
for the record, this is how I made it work:
options = fitoptions('exp1');
options.Lower = [0 -Inf];
options.Upper = [Inf 0];
coeffs=fit(data(:,1),data(:,2), 'exp1',options);
Thanks again for your help, Torsten.
Related Question