In this document we introduce the reader to the basics of the use of the timeslab program. The following topics are covered:
quit
.
When timeslab starts, it is waiting for you to tell it what to do. An example of something you can do is
? x=wn(0,10) ? xthe first line of which uses the
wn
command to
generate 10 N(0,1) random numbers and put them into the array
called x
, while the second line shows that saying
the name of a variable results in it being displayed on the screen:
normal white noise series 1 | -1.15740 -1.09655 -0.168238 -0.197440 0.934374 6 | 0.379097 0.322437 0.578831 0.540704 0.749487(the numbers in the left column are the indices of the values in the second column, and the values are read across the rows).
To get a list of all the timeslab commands, one enters the command
? helpTo get help for a particular command, enter
help(command name)
,
for example,
? help(wn)gives
WN x=WN(seed,n) or x=WN(seed,n,dist) Generate a white noise series of length n using seed as the random number generator seed. dist is one of the following distributions : dist : 1:N(0,1) 2:U(0,1) 3:unit exponential 4:logistic 5:Cauchy 6:extreme value 7:lognormal 8:double exponential The form x=WN(seed,n) generates a Gaussian series.
x
shows that arrays have a name (here it is x
)
a label (such as "normal white noise
series" in this example), a length
(here it is 10), and values. You can have as many as 60 arrays
and the total number of elements in all arrays combined must be 10,000
or less.
In addition to arrays (which are always treated as floating point real numbers), timeslab also has integer scalars, integer reals, and string variables as in
? n=100 ? c=2.75 ? fname='air.dat'You can also have 60 of each of these. Variable names can have at most 15 characters and must start with a letter.
To see what variables have been defined, one enters the info
command
? infowhich gives
Number of arrays and Free Elements: 1 9990 NAME LENGTH LABEL ---------------------------------------------------------------- x 10 normal white noise series ---------------------------------------------------------------- n = 100 c = 2.75000000 fname = air.datfor what we have done so far (note that there are 9,990 "free elements" as we have defined a single array containing 10 elements).