2

I'm not advanced in Mathematica but I'm trying to get better.

I have a big set of Data and I want to Plot the first row against the other ones. I tried to set the Rows into a list and run a "do loop" over all Rows.

My Code :

ClearAll["Global`*"]
Data = Import["file", "Table"];
Time = Table[1/60 i, {i, 0, 1430}];
Rows[k_] = Do[List[Transpose[{Time, Data[[All, k]]}]], {k, 1, 16}]
Toplot = Do[Transpose[{Time, Rows[k]}], {k, 1, 16}];
ListPlot[{Toplot}];

I would be grateful for some help and tips.

Öskå
  • 8,587
  • 4
  • 30
  • 49
MetStudent
  • 21
  • 1
  • 6
    You should provide a sample of the Data :) – Öskå Jul 22 '14 at 09:15
  • 1
    Have a look at Part and Span. You will most likely not need a loop at all. Useful: http://mathematica.stackexchange.com/questions/3069/elegant-operations-on-matrix-rows-and-columns – Yves Klett Jul 22 '14 at 10:44
  • as a fundamental issue your Do loops should be Tables. The posted answer is better of course. – george2079 Jul 30 '14 at 12:31

1 Answers1

2

First of all, you should avoid using variables names with capital letters : these correspond to built-in functions.

Then, if I understood correctly, you want to plot the rows of your data versus time. If so, the following code should work :

data = Import["file", "Table"];
time = Range[0, 143/6, 1/60];
ListPlot[Transpose[{time, #}] & /@ data]
Mammouth
  • 481
  • 2
  • 9