home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / sci / math / symbolic / 3000 < prev    next >
Encoding:
Text File  |  1992-11-17  |  1.7 KB  |  36 lines

  1. Newsgroups: sci.math.symbolic
  2. Path: sparky!uunet!convex!darwin.sura.net!Sirius.dfn.de!chx400!bernina!neptune!monagan
  3. From: monagan@inf.ethz.ch (Michael)
  4. Subject: Re: MAPLE: Reading list of points from external file
  5. Message-ID: <1992Nov17.171435.19540@neptune.inf.ethz.ch>
  6. Summary: Reading data into Maple
  7. Sender: news@neptune.inf.ethz.ch (Mr News)
  8. Nntp-Posting-Host: rutishauser-gw.inf.ethz.ch
  9. Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
  10. References: <ROSE.92Nov10172623@t524i5.telematik.informatik.uni-karlsruhe.de> <CHUCK.92Nov16190416@nimbus.drexel.edu>
  11. Distribution: sci.math.symbolic
  12. Date: Tue, 17 Nov 1992 17:14:35 GMT
  13. Lines: 21
  14.  
  15.  
  16. The question was asked how to read data from an external file into Maple.
  17. There are no facilities in Maple V for reading arbitrary data.  The comment
  18. by one user that Maple should not call itself a programming language if
  19. it cannot read data is fair comment.  What you must do is make the
  20. data that you want to read into Maple valid Maple input.  I.e. if you
  21. have numbers on a line separated by spaces you must insert commas between
  22. them and assign them to a variable, and add a semicolon or colon at the end.
  23. I.e. make the input file look like
  24.  
  25.    DATA := 2.3, 3.4, 5.6 ;
  26.  
  27. Once you have read the file, you can put the sequence in a list or array
  28. and continue.  The new version, Release 2, has the equivalent of C's scanf,
  29. also printf, and some other utilities that make reading and writing data
  30. to files much easier to do.  I wrote an article on how to read and write
  31. data from files in the share library.  It's the
  32. file maple/5.0/tex/program.tex which you can get from
  33. anonymous ftp at daisy.uwaterloo.ca
  34.  
  35. Michael Monagan
  36.