# How to manipulate some list-plot in Mathematica

I have two separated matrices in the form

 X[[i*dx,j*dt]] and V[[i*dx,j*dt]]


where i & j are integers from (1 to N) & (1 to M). V & X are velocity and space respectively in phase space.

I want to figure out a two dimensional (V-X) plot of these two matrices for different values of time (which is j*dt) in a sequence manner. I can use the following command to plot it for an specific time (e.g. j*dt=5) for all space:

ListPlot[Table[{V[[i,5]], X[[i,5]]}, {i, 1, N}];


But I'm in trouble to show it in sequence . I tried "Manipulate" command:

Manipulate[ListPlot[Table[{V[[i, j]], X[[i, j]]}, {i, 1, N}]], {j, 1, M}];


But unfortunately it doesn't work. Just notice that I need 2-D figure that represent a (V-X) plot of all space for different times. I don't know what should I do.

• You should learn to format your code when asking Q, post self contained snippets and not use single capital letters in MMA. Jan 30, 2014 at 20:37
• Please provide a data example to work on.
– Kuba
Jan 30, 2014 at 20:41

## 1 Answer

n = 20; m = 500;
x = RandomReal[{0, 30}, {m, n}];
v = Table[RandomReal[{0, k}], {m}, {k, n}];
Manipulate[ListPlot[Table[{v[[i, j]], x[[i, j]]}, {i, 1, m}],
PlotRange -> {{0, n}, {0, 30}}], {j, 1, n, 1}]