You should always call your function before you try to optimize. The call gives an error: x = {2 2 2 2}; f = f_gglfr(x); The reason is that your TEMP variable has some large numbers (greater than 7000), so 1-exp(-temp) is numerically 0. I think there might be another problem.When aarset is a vector, the function f_ggfr returns a vector. I assume you intend for f_ggfr to be a scalar function.
... View more