I am trying to solve the following function with fminunc:
Σ((x(i)-1).^2) for i = 1 to 20
My code is below:
fun4 = @(x) sum((x(i)-1).^2, i, 1, 20)[x,fval,exitflag,output]= fminunc(fun4,[1,1])
And, it gives the following error:
??? Error using ==> sym.sym>notimplemented at 2514 Function 'subsindex' is not implemented for MuPAD symbolic objects.
Could you help me, please?
Best Answer