Re: ReadList of Complex Numbers
- To: mathgroup at smc.vnet.net
- Subject: [mg21562] Re: ReadList of Complex Numbers
- From: "Mariusz Jankowski" <mjkcc at usm.maine.edu>
- Date: Sat, 15 Jan 2000 02:04:04 -0500 (EST)
- Organization: University of Southern Maine
- References: <85mmik$26i@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Dear Srikanth, I assume you have your data organized as two numbers in each row, separated by white space and/or coma. ReadList makes reading such data very easy and it will work with versions 3 and 4 of Mathematica. First read the raw data: rawdata = ReadList[filename, {Number, Number}] filename is a string, for example, in Windows it could be "c:\\temp\\mydata.txt" (note the use of double back-slash). Consult online Help for the proper method of specifying the path on other platforms. Next and last, convert the pairs of Real numbers to Complex: complexdata = Apply[Complex, data, {1}] Hope this solves your problem. Mariusz ====================================================== Mariusz Jankowski University of Southern Maine mjkcc at usm.maine.edu "Srikanth Raghavan" <srirag at pas.rochester.edu> wrote in message news:85mmik$26i at smc.vnet.net... > Hello, > I have a data file of an array of complex numbers created by a > Fortran program. I want Mathematica to read this data file as an array > of complex numbers recognizing each row as a complex number. I have not > been able to find any way of doing this. Could anyone help? Please reply > to my e mail address in addition to posting the reply to this newsgroup > if possible. > Thanks > Srikanth > > -------------------------------------------------------------------------- - > > Srikanth Raghavan > Rochester Theory Center for > Optical Science and Engineering > Dept. of Physics and Astronomy email: srirag at pas.rochester.edu > University of Rochester > Rochester, NY 14627 > > -------------------------------------------------------------------------- - > > > >