To create a symbolic matrix with variables and functions like cosine, use the Symbolic Math Toolbox. Symbolic variables can be defined using the "syms" function, and then assembled into a matrix as needed.
For example, to create a 4x3 matrix with symbolic variables "x" and "y", and expressions involving cosine:
cos(x*y), x - y, cos(x - y)]
A =

This creates a 4-by-3 symbolic matrix containing a mix of variables and cosine expressions.
For more details please refer to the following MathWorks documentation:
Hope this helps!