Numerical optimizers CANNOT use symbolic variables.
That is, this is meaningless when using a tool like fmincon.
Yes. I know you don't know the value of those variables, so you think they need to be symbolic. Not true.
Some people build their problem using symbolic tools, then convert things into a numerical form, using a tool like matlabFunction. While that can work, it is a terribly slow way to write code. It is a slow working crutch that has no purpose if you understand how to use and write functions. So just learn how to use functions.
For example, suppose I create the function:
fun = @(t) sum(t.^2) - 1;
Do I need to know the value of the variable t when I create that function? OF COURSE NOT! t can be anything. fun operates on the variable t. I can minimize fun. I can look for roots, perhaps. Whatever. But there is ABSOLUTELY NO NEED that t be symbolic.