# Export array data into a file

I tried to solve some equation for different values of parameter t and put results into array. Then I wanted to write this data into a txt-file. So i did it with Write function. But strings in this file look like:

{{y -> -300.339}}


Are there some parameters of Write function for numbers (with sign) writing only?

Array[f, 1000]

x := 2
z := 1
v := 0.98
T := 10
dt := T/1000

For[i = 0, i < 1000,
i++, f[i] = Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y]]


I tried this one, but it doesn't help:

For[i = 0, i < 1000,
i++, { a = Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y],
f[i] /. a}]

• It is not clear what you are asking. If your results are in the form of Rule expressions you will need to convert them to bare numbers. See for example: (1616091), (8355218), (6669) – Mr.Wizard Feb 8 '15 at 11:17
• Okay, that's a code. Array[f, 1000] x := 2 z := 1 v := 0.98 T := 10 dt := T/1000 For[i = 0, i < 1000, i++, f[i] = Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y]] I tried this one, but it doesn't help: For[i = 0, i < 1000, i++, { a = Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y], f[i] /. a}] – newt Feb 8 '15 at 11:34
• Please use the edit link below your question to include code examples. – Mr.Wizard Feb 8 '15 at 11:35
• I posted an answer. I hope the examples help you. I am not sure what you intend for f so I left it out. If you wish to save the definition of f itself please see: (2008) – Mr.Wizard Feb 8 '15 at 11:43

x := 2
z := 1
v := 0.98
T := 10
dt := T/1000

Table[
y /. Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y][],
{i, 0, 999}
]

{-300.33859829722434, -299.8391603699061, -299.3397243096371,
-298.8402901257249, . . ., 2.506139642749351, 2.5124784155139106}


You should be able to Export that as a plain list of numbers. Be aware that I extract only the first solution, should more than one exist, but I am guessing that is OK.

If you need a table including the i values:

Table[
{i, y /. Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y][]},
{i, 0, 999}
]