Message Boards Message Boards

0
|
4011 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Combining tables to achieve coordinate pairs

Posted 10 years ago
Hi - My problem is frustratingly simple, but I've struggled with it long enough that I need to reach out for help.

I need to work with data from elevation measurements regularly spaced around a circle. The number of measurements varies from 8 to 30 (I attach a sample 16-spot file).  I successfully import from a CSV file, flatten the data no problem, and I have a 1-dimensional matrix od length n.
S = Flatten[Import["desktop/Settlement Data.csv"]]
n = Length[S]

To work with the data, though, I need to represent its angular coordinate instead of its List position. The measurements are regularly spaced around the circle, so it's simple enough to build a 1-D table of the angular coordinates that correspond with each measurement:
R = Drop[Table[i, {i, 0, 2 Pi, (2 Pi/n)}], -1]

The problem:  How do I combine the two tables into {Measurement, Angle} pairs so I can PolarPlot{ S,R} instead of ListLinePlot?  This is the best that I can do, but it doesn't actually create the 2-d table I need for cosine curve fitting:
ListLinePlot[S, DataRange -> {0, 2 Pi}, Filling -> Axis, Ticks -> {{0, Pi/2, Pi, 3 Pi/2, 2 Pi}, Automatic}]

Any suggestions greatly appreciated.
Doug
Attachments:
POSTED BY: Doug Schwarm
2 Replies
Well done, Girish!  Thanks very much.  I had not heard of a Thread function and could not have searched it out.

Cheers,
Doug
POSTED BY: Doug Schwarm
Posted 10 years ago
How about
ListPolarPlot[Thread[{R, S}]]
POSTED BY: Girish Arabale
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract