For example, say I wanted to plot Sin(x) like this:
Plot[Sin[x],{x,0,2 Pi}]
But instead of plotting to a graph, I want to now tabulate the values of Sin[x] to a data file. How do I achieve this?
EDIT: Sorry I wasn't clear enough, I mean plot the x values in one column and the y values in the second column
Answer
First create your points, running from 0 to 2 Pi at intervals of 0.01.
points = Table[{x,Sin[x]}, {x, Range[0, 2 \[Pi], .01]}];
You can plot them with:
ListLinePlot[points]
And export them to a csv file with:
Export["points.csv", points]
Comments
Post a Comment