the equivalent script commands.
The first thing you will need to do
is get your data into Extrema. Data is
stored in variables and is referenced by
the variable’s name. The first character of
a variable name must be alphabetic and
cannot be any longer than 32 characters.
Other than these restrictions, variable
names can contain any alphabetic or
numeric characters, underscores or
dollar signs. Unlike most things in Linux,
variable names are case-insensitive. And
remember, function names are reserved,
so you can’t use them as variable names.
String variables can contain either a
single string of text or an array of text
strings. Numeric variables can contain
a single number, a vector (1-D array), a
matrix (2-D array) or a tensor (3-D array).
All numbers are stored as double-precision
real values. Unlike most other programming
languages, these arrays are indexed starting
at 1, rather than 0. There are no limits
to the size of these arrays, other than
the amount of memory available on your
machine. Indexing arrays in Extrema can be
interesting. If you want the eighth element
of array x, you simply can reference it with
x[ 8]. You can grab elements 8, 9 and
10 with x[8: 10]. These indices can be
replaced with expressions, so you could
get the eighth element with x[ 2^ 3].
There also are special characters that
you can use in indexing arrays. The
statement x[*] refers to all the values in
24 / SEPTEMBER 2012 / WWW.LINUXJOURNAL.COM
the vector. If you want the last element,
you can use x[#]. The second-to-last
element can be referenced with x[#-1].
READ file1.dat x y
You also can read in all of the data and
store it into a single matrix with:
READ\matrix file1.dat m nrows
In order to do this, you need to provide
the number of rows that are being read
in. You also can generate data to be used
in your analysis. If you simply need a
series of numbers, you can use:
x = [startval:stopval:stepsize]
This will give you an array of numbers
starting at startval, incrementing by
stepsize until you reach stopval.
You can use the GENERATE command to
do this as well. The GENERATE command
also will generate an array of random
GENERATE\RANDOM x min max num_points