I am trying to use the fit.m function, but matlab throws the "complexValueComputed" exception, even though my x variable could not created complex values.
My x variable is: x = 1 - T./Tcrit and T is an array with max(Tsat) < Tcrit.
My y variable is an irrational function: y = a1 + a2 .*x.^(1/3) + a3 .* x.^(2/3)+ a4 .* x.^(3/3)+...
So there is just a possibilty to create complex values for Tsat > Tcrit, but this is not possible.
I even try to solve this problem by using the abs() function for my x variable, but nothing changed.
The error message is: "Complex value computed by model function, fitting cannot continue.Try using or tightening upper and lower bounds on coefficients."
and appears in fit.m in line 116 or for the iFit.m function in line 348.
Any help for resolving this problem would be greatly appreciated!