Reading data files with Maple

Maple can read data files and store them in lists which can be used by other Maple functions. Suppose, for example, that we have a file "foo" which looks like this:
  0 0
  1 1
  2 0
In Maple we execute the command
  d := readdata( foo, 2 );
where the "2" refers to the number of columns. The variable "d" now has the value
  [[0,0], [1,1], [2,0]]
This structure, which we view as a list of (x,y) coordinates, defines a broken-line path. To plot it, we do this:
  plot(d);

Exercise: Picture in your mind's eye the figure which d represents.


Notes

Back to Maple

Back to Department of Mathematics, University of Utah

Last edit by jac , March 27, 1995.
Copyright © 1995 Department of Mathematics, University of Utah