3.2 Creating 3D Graphs.....................................................................59
3.2.1 Creation of 3D Line Plots ........................................................59
3.2.2 Creation of 3D Mesh and Surface Graphs.................................59
3.2.2.1 Examination of a Function’s Critical Points.........................65
4. Control Flow ....................................................................................68
4.1. Logical and Relational Operators..................................................68
4.1.1 The
a
a
n
n
y
y and
a
a
l
l
l
l Functions.......................................................70
4.2. Conditional Statements ...............................................................71
4.2.1 The
i
i
f
f Statement.....................................................................72
4.2.2 The
s
s
w
w
i
i
t
t
c
c
h
h Statement.............................................................73
4.3. Loop Expressions........................................................................73
4.3.1. The
f
f
o
o
r
r Loop..........................................................................74
4.3.2. The while Loop......................................................................74
4.3.3. Nested Conditional and Loop Expressions................................75
4.3.4. Additional Control Flow Statements........................................75
5. m-files: Scripts and Functions...........................................................77
5.1 m-files: Functions ........................................................................77
5.1.1 Basic Parts of a Function ........................................................79
5.1.1.1 Function Definition Line....................................................79
5.1.1.2 The H1 Line .....................................................................81
5.1.1.3 The Help Text...................................................................81
5.1.1.4 The Body Text..................................................................82
5.2 Scripts........................................................................................82
6. Cells and Structures.........................................................................85
6.1 Cells...........................................................................................85
Cell indexing..................................................................................86
Content indexing............................................................................87
6.2 Structures...................................................................................89
Building structure arrays using assignment statements.....................90
Building structure arrays using the
s
s
t
t
r
r
u
u
c
c
t
t function...........................91
7. Entering and Saving Data Files..........................................................94
7.1. Reading Text ASCII Files: The load
command ................................94
7.2 Saving Text ASCII Files: The
s
s
a
a
v
v
e
e
command...................................96
7.3 Other Reading and saving commands............................................97
8. Case Studies....................................................................................98
8.1 The Black – Scholes- Merton Options Pricing Formula.....................98
8.1.1 Implementation of the BSM Formula........................................99
8.1.2 BSM Derivatives...................................................................101
8.1.3 BSM Plots and Surfaces........................................................102
8.1.4 BSM Implied Volatility..........................................................102
8.2 Function Minimization and Plots.................................................105
8.3 Portfolio Optimization.................................................................112
References.........................................................................................118
Komentarze do niniejszej Instrukcji