Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

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

1 Answer 1

up vote 1 down vote accepted
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}]

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.