# How can I use a matrix element to plot with ParametricPlot? [closed]

This is a completely simplified example to demonstrate the issue.

I have a matrix, it contains an uninitialized variable. I need to extract that element of the matrix and use in to plot a parametric function of that variable.

m = t; // this is the matrix 1x1, inserted via the graphical context menu;
ParametricPlot[{Part[m, 1], 1}, {t, 0, 1}]

I get an empty plot.

Strangely, it works with the plain plot, I checked it, but I need the parametric one:

Plot[{Part[m, 1]}, {t, 0, 1}]

I need this to perform certain transformations on "vectors", which contain variables, in order to plot this. I can go without it, currently I'm simply doing:

Print[Part[m, 1]];

then manually copy-pasting the output of Print into ParametricPlot:

ParametricPlot[{t * Cos[Pi], 1}, {t, 0, 1}]

and get what I want. The problem is that I have many more values, than in this example. I thought, that it might be that someone could suggest something.

• This is not Matlab. As defined, m is a scalar. (And your second example suffers from the same problem btw.) Only m = {{t}} defines a matrix; m = {t} defines a vector. The latter is probably what you are looking for. Commented Dec 26, 2019 at 23:59
• @HenrikSchumacher I inserted the matrix via the graphical interface with the context menu's "insert matrix", so it's definitely a matrix. It's just that in my Mathematica notebook it looks like this (without any parenthesis). The second example works, I double checked.
– d.k
Commented Dec 27, 2019 at 0:04
• Ah, I see. Fortunately, your problem is already solved. Commented Dec 27, 2019 at 6:03

When I define m in the manner you describe, I get

And, yes, that's definitely a 1 x 1 matrix, which means its first (and only) element is referred by m[[1,1]] (or Part[m,1,1]). So to make a parametric plot, I write

ParametricPlot[{m[[1, 1]], 1}, {t, 0, 1}]

and get