Thanks for the answer but I still have the problem. I think I have not explained well. Consider that I want the user to change only 3 lines of the code:
syms (x1,x2,x3) %enter the number of independent variables (free to change)
f=x1^2+x2^3+4*x1*x2 %the user may enter another function with more variables
V0=[5,5,5] %initial guess the user may enter. first number corresponds to x1, second to x2....
what I need is a piece of code that evaluate the expression f considering the vector V0. And the number of variables on f (and also the size of V0) may change every time someone runs the script.
I think its more clear now. Sorry for the confusion.