a problem about mathematica output
- To: mathgroup at smc.vnet.net
- Subject: [mg82379] a problem about mathematica output
- From: qwer <chendy0524 at gmail.com>
- Date: Fri, 19 Oct 2007 04:51:26 -0400 (EDT)
I have a puzzle when using mathematica, I want to out put my resuts to
a .dat file ,but I do not know how to control the digital, for
example:
the mathematica code is
f[x_]:=NIntegrate[Sin[y]/y,{y,0,x}];
OpenWrite["xx.dat",FormatType->TextForm];
Do[Write["xx.dat",N[x,4]," ",N[f[x],4]],{x,0.001,1,0.05}];
Close["xx.dat"];
then in xx.dat you can find
0 0.
0.05 0.0499931
0.1 0.0999445
0.15 0.149813
0.2 0.199556
0.25 0.249134