problem with curve fitting in Matlab

Hi all,

I'm trying to fit a data with a function called "refl_pp" that I construct myself. I tried to use fit routine:

ffit = fittype('@(A1,A2,k1,k2,Step,t,t0,w)refl_pp','independent','t','problem','Step');
F=fit(t,data',ffit,'StartPoint',[0.0005 0.0001 3. 1. 0.1 3.3],'problem',Step);

As a result I get an error message:
-----------------------------------------------------------
??? Matrix dimensions must agree.

Error in ==> fit at 486
errstr = handleerr( errid, errmsg, suppresserr );

Error in ==> TiSe_phonon_fit at 37
[F,gof]=fit(t,data',ffit,'StartPoint',[0.0005 0.0001 3. 1. 0.1 3.3],'problem',Step);
------------------------------------------------------------

I had no problems, if I pass a function as a string in fittype, so it seems like I handle the function not correctly.
Does anybody know what the problem is?

thank you in advance, katja
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories