MATLAB FINANCIAL DERIVATIVES TOOLBOX Uživatelský manuál Strana 8

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 119
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 7
7
m-file is a file that contains Matlab’s language code. m-files can be
functions that accept arguments and produce output, or they can be
scripts that execute a series of Matlab statements. For Matlab to
recognize a file as an m-file, its file name extension must be *.m.
functions are m-files that can accept input arguments and return
output arguments. The name of the m-file and the calling syntax
name of the function should be the same. Functions operate on
variables within their own workspace, separate from the workspace
you access at the Matlab command prompt. Functions are useful for
extending the existing Matlab language for personal applications (e.g.
create a function that returns the expected return and standard
deviation related with a set of companies).
scripts can operate on existing data in the workspace, or they can
create new data on which to operate. Although scripts do not return
output arguments, any variables that they create remain in the
workspace, to be used in subsequent computations. In addition,
scripts can produce graphical output using functions. Scripts are
useful for automating a series of steps that are needed to be
performed many times (e.g. to create a script that executes a series of
functions related to portfolio optimization).
Every variable has a name and a data type. With Matlab, accepted
variables names do not start with symbols (like ~, +, -) or numbers,
use lower and upper case letters do not exceed 63 characters and do
not resemble reserved words and build-in functions. Acceptable
definitions include: Time, x, y, XYZ, Ray_value, U3e23 etc. Non-
acceptable definitions are the followings: +Time, 3587num, _XYZ,
rayX-values, for, end, while, case, day etc. The data type is a
classification of particular type information. Among the most usable
types are: integer a whole number, a number without any fraction
(e.g. 12, 10, 89); floating point a number with a fractional part (e.g.
25.7, 78,1, 0.000005, 5e-5 which is equal to 5*10
-5
); and character
readable text character (e.g. 'k'). With Matlab, it is not need to type or
declare variables used in the m-files. Any operation that assigns a
value to a variable creates the variable, if needed, or overwrites its
current value, if it already exists.
Zobrazit stránku 7
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 118 119

Komentáře k této Příručce

Žádné komentáře