Hi.
I have symbolic expressions in a script file (that represent calculated partial derivatives. Because I need, at each iteration, that get the numeric value of the symbolic expression depending on the new set values of variables, I created a function, that compute this)
Since that symbolic expression is different from case to case, is there a possibility that the expression automatic import in function without manual typing these expressions. I want to define this expression in one place in the script file, and than when you call functions, this expression be automatically loaded in function. Thank you in advance.

In each iteration, I want to compute numeric value of this expression for different values of symbolic variables. I first try to solve my problem with symbolic substitution, subs(old, new), and this work, but it is so slow for my purposes. For example, for 3000 iterations, whole script file executes for 1.5 [min].

On this way I avoid difficulty in calculating with symbolic expression, and this work very fast, etc. whole algorithm is executed for only 1-2 [sec].

Now it would mean a lot to me if I find way that Matlab automatic call this vector function 'f' from script file, without my typing this expression. Since expression 'fs' represents some partial derivative, which is different from case to case, it would be nice that this vector function 'fs' be called from one place in script file.

Be careful, matlatFunction idea of which order the variables should be in are not necessarily the same as yours. To avoid surprises I recommend using the 'vars' parameter if there are multiple variables.