I am getting error on line 5 for the code below. My Y1 and Dmge is already in the workspace, but they keep saying that my 'x' is an undefined variable or function. Same for my 'y'.
A = x0(1); B=x0(2); C=x0(3);
y = Dmge;
E = sum((A*exp(-exp(-B*(x-C)))-y).^2);