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'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.

share|improve this question
6  
You should provide a sample of the Data :) –  Öskå Jul 22 at 9:15
1  
Have a look at Part and Span. You will most likely not need a loop at all. Useful: mathematica.stackexchange.com/questions/3069/… –  Yves Klett Jul 22 at 10:44
    
as a fundamental issue your Do loops should be Tables. The posted answer is better of course. –  george2079 Jul 30 at 12:31

1 Answer 1

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]
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.