Re: ask for help on Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg17568] Re: ask for help on Mathematica
- From: "Allan Hayes" <hay at haystack.demon.co.uk>
- Date: Mon, 17 May 1999 02:14:24 -0400
- References: <7hge3t$4d4@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
PaddedForm seems to work (in general we also need OutputForm to format)
Write["temp" ,
OutputForm[
PaddedForm[TableForm[{{0.1 ,1.111111, 123.11111, 15.11111,1.11111},
{0.1 ,1.111111, 123.11111, 1.11111,1.11111}}],
{10,7}]]
]
Close["temp"];
Look at what we have made:
!!temp
0.1000000 1.1111110 123.1111100 15.1111100 1.1111100
0.1000000 1.1111110 123.1111100 1.1111100 1.1111100
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
Ming Huang <mhuang at leland.Stanford.EDU> wrote in message
news:7hge3t$4d4 at smc.vnet.net...
> Hi,
>
> Could someone tell me how to use Mathematica to write into
> a file the numerical numbers of 5 columns of variables, as follows?
>
> What I need is to be able to format the numerical output to be of,
> say, 8 digits for each number (the FortranForm gives too many digits).
> It is very easy to do this kind of things in Fortran or C,
> but I couldn't find a simple way to do it in Mathematica,
> after searching through the Mathematica Book for a long time.
>
> Please reply to my email address at
>
> mhuang at leland.stanford.edu
>
> Thanks for your help!
>
> Ming
>
>
> 0.1 1.111111 1.11111 1.11111 1.11111
> 0.1 1.111111 1.11111 1.11111 1.11111
> 0.1 1.111111 1.11111 1.11111 1.11111
> 0.1 1.111111 1.11111 1.11111 1.11111
> 0.1 1.111111 1.11111 1.11111 1.11111
> 0.1 1.111111 1.11111 1.11111 1.11111
> 0.1 1.111111 1.11111 1.11111 1.11111
> 0.1 1.111111 1.11111 1.11111 1.11111
>