
script that calls various options pricing function in order to price a call option
and compare the pricing accuracy of each model).
Unlike functions, a script has no a specific structure. It includes a number of
commands that are serially executed. As long as the command series has a
logical interpretation, the script will result to the desire output. Remember
that a script does not take and does not return input and output arguments
respectively. The vectors and matrices (variables or scalars) are stored in the
Matlab’s workspace. An example of a script follows.
Let’s say that we need to create a script with the name “CompuStat.m” that
should store in a vector named
D
D
a
a
t
t
a
a, the mean, standard deviation, median,
covariance, minimum and maximum of the main diagonal of a magic square.
Figure 13, shows how a version of such a script might look like for an 8-by-8
magic square.
Figure 13: An example of a script
Commentaires sur ces manuels