## Mathematica, Table Generation & Rescaling Axes

Hi,

Have a problem: I'm generating 2 lists in Mathematica:

In: time = Table[(r - 1.0)/10.0 , {r, 10}]
Out: {0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9}

In: noise = Table[RandomVariate[NormalDistribution[0, 1.4], 10]]
Out: {2.16764, -1.38203, -0.395928, -0.58616, 0.714317, -1.46027, \
-0.100758, -0.162811, -1.34202, -0.612508}

First list is to set up a time axis for simulated data acquistion and second is for the simulated data (white noise centered at 0 with a stddev of 1.4).

First of all, despite lengthy attempts, I can't seem to combine the lists into a table structured like {0., 2.16},
{.1, -1.38},
{.2, -.39}, etc.
If I could do this I'd then like to do a ListPlot of the data, with the X axis stopping at 1.0 or 0.9 seconds and the noise on the Y axis.

After multiple unsuccessful attempts at this, I then ListPlotted the data and the times separately (both on the Y axis). Unfortunately my X axis always goes from 0 to 10 since 10 data points are obtained for both lists, as is expected. I thought I would be able to easily scale the termination of the X axis from 10 down to 1, since the data is obtained in 1 second. Again, despite hours of work, I can't figure out how to do this. I have Mathematica Student Version 8. This all seems like such a simple problem to solve since I'm simulating sampling data (noise) at a sampling rate of 10/sec.

I'm requesting input on both of these issues. How do you make a plotable table from 2 lists, making one list the X axis and one the Y axis? Secondly, how do you rescale data points indexed on the X axis down into a one second time period to correspond to the sampling rate?

Thanks,

glamotte7
 PhysOrg.com science news on PhysOrg.com >> New language discovery reveals linguistic insights>> US official: Solar plane to help ground energy use (Update)>> Four microphones, computer algorithm enough to produce 3-D model of simple, convex room
 Combining the two lists is easy: JoinedList = Table[{time[[i]],noise[[i]]},{i,10}]
 Hi phyzguy, That worked great! Another related question if I may: I wish to add 2 of these tables together to get a new table. Each table has 2 columns. I want the 2nd columns (the Y columns) to add together in the usual way. I want the 1st columns (the X columns) to each be multiplied by 1/2 and then added together. How would I do that? Thanks, glamotte7

## Mathematica, Table Generation & Rescaling Axes

If you need to combine two lists as you describe

In[1]:= time={0.,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9};
noise={2.16764,-1.38203,-0.395928,-0.58616,0.714317, -1.46027,-0.100758,-0.162811,-1.34202,-0.612508};
Transpose[{time,noise}]

Out[3]= {{0.,2.16764},{0.1,-1.38203},{0.2,-0.395928}, {0.3,-0.58616},{0.4,0.714317},{0.5,-1.46027}, {0.6,-0.100758},{0.7,-0.162811},{0.8,-1.34202}, {0.9,-0.612508}}

With the first element of each pair being 0, .1, .2 ... you should see that ListPlot does use 0 to 1 for your X axis.