Hello. Basically, I need to optimize the following function
The minimum value for 'n' is 2. Imagine we have n = 25. I have a sum of series so I tried the following:
syms i n
x0=[2:25];
i=[1:25];
f1= @(x)(x(1)+7)^8
f2 = @(x)((0.01*x(i)-i)^2)/i
All looks good until I try to sum both parts
fun = f1+symsum(f2,i,2,25);
Check for missing argument or incorrect argument data type in call to function 'symsum'.
If the previous step was correct, I would call "fminunc(fun,x0);" to optimize the function.
Could you explain why I get this error? 'i' should be a symbolic variable because of being created by syms call. Set of 'x' is defined. I must have missed something but can't find out what.