Hi there,
It is my function:
function [y, cons] = TMS_CONSTR_objfun(x)y = [0 0];cons = [];x(1:10)=1;d(1:10)=0;sp(1:10)=0;y(1)=sum(x(1:10));for h=1:10 d(h)=x(h)*xe(h); sp(h)=x(h)*ve(h);enddd=d(d~=0);spp=sp(sp~=0);n=length(dd);for j=2:n-1 y(2)=abs(((dd(1)+dd(2))/(2*spp(1)))+9.7-((x(n)+x(n-1))/(2*spp(n))+ sum((x(j+1)-x(j-1))/(2*spp(j))))); end
xe and ve are variables that imported from excel. I keep receive this error:
Undefined function 'xe' for input arguments of type 'double'. and
Undefined function or variable 'x'.
Please help. Thanks
Best Answer