# Matrix as a function of $x$ [closed]

I need to use four functions of $x$

DD11 = @(x) x+0*x;
DD12 = @(x) x^2+0*x;
DD21 = @(x) cos(x)+0*x;
DD22 = @(x) 1+0*x;


and since they all represent the same physical quantity, and also for the sake of convenience, I would like to define in a matrix form:

DD = @x [x x^2; cos(x) 1];


If I do this, how will I recall the different elements at a given point later on?

For example, the syntax DD[1,2](0) or DD(0)[1,2] don't work... Thanks!

-

## closed as unclear what you're asking by Mr.Wizard♦Jun 6 '14 at 11:38

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Are you sure that you are trying to code something in Mathematica? –  Öskå Jun 6 '14 at 10:24

You might try

dd[x_] := {{x, x^2}, {Cos[x], 1}}
dd[2] // MatrixForm


You can extract components with the syntax

dd[2][[2, 1]]

Cos[2]

-