use the comma-separated list operator :
together with cell arrays::
param = {17,-77,95,112};
result = cfit(ft,param{:});
you can get param
in cell form with mat2cell
.
Question
Is there a possibility to construct a cfit-object with a vector of parameters like:
param = [17,-77,95,112];
ft = fittype('poly3');
result = cfit(ft,param);
instead of:
ft = fittype('poly3');
result = cfit(ft,17,-77,95,112);
Thanks in advance!
Solution
use the comma-separated list operator :
together with cell arrays::
param = {17,-77,95,112};
result = cfit(ft,param{:});
you can get param
in cell form with mat2cell
.