Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Exporting Results from NDSolve to formatted table' topicStudent Support Forum > General > "Exporting Results from NDSolve to formatted table"

Next Comment >Help | Reply To Topic
Author Comment/Response
Simon
11/28/11 10:29am

hello!

i have some trouble exporting data, resulting from ndsolve into a simple table.

example:

s = NDSolve[{y'[x] == y[x], y[0] == 1}, y, {x, 0, 5}][[1]]

that's what i want:

tabelle =
TableForm[Table[{x, PaddedForm[y[x] /. s, {8, 5}]}, {x, 0, 5, 1}]]

resulting output (i guess it will be destorted here, but in mathematica it looks like intended):

0    1.00000
1    2.71828
2    7.38905
3    20.08552
4    54.59811
5    148.41317


but when i use export

Export["table.dat", tabelle]

it results:

0   PaddedForm[1., {8, 5}]
1   PaddedForm[2.7182815795161006, {8, 5}]
2   PaddedForm[7.389052124880069, {8, 5}]
3   PaddedForm[20.08552111064446, {8, 5}]
4   PaddedForm[54.59810628280756, {8, 5}]
5   PaddedForm[148.4131732695484, {8, 5}]

so how can i export this data to a table, using paddedform?

i already tried to apply ToString to the expression, but then there is a blank line between every data-line.

URL: ,

Subject (listing for 'Exporting Results from NDSolve to formatted table')
Author Date Posted
Exporting Results from NDSolve to formatted table Simon 11/28/11 10:29am
Re: Exporting Results from NDSolve to formatted... Simon 11/29/11 08:49am
Next Comment >Help | Reply To Topic