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!

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top