Maybe your function is not prototyped as double MyFunc(double x, double a, double b);
Origin will automatically loop through all elements of a dataset if it is passed into the 1st argument of a function that is prototyped as double and returning double.