
To find what other useful commands can be accompanied the
m
m
e
e
s
s
h
h and
s
s
u
u
r
r
f
f
commands, use the online help.
3.2.2.1 Examination of a Function’s Critical Points
Many times, a researcher is faced with an unconstrained optimization
problem. Than is, it has a two variable function Z=f(x,y) and wants to
examine this function in a certain area in order to locate any minimum,
maximum or saddle point(s). From the previous section, it is apparent that
in the range [-10,10] the peaks function seems to have various critical
points. In optimization theory, a critical point can be located via the use of a
contour plot. A contour plot depicts the level curves of f(x,y) for some values
V. In other words, we project the sections/incision of various heights of the
Z=f(x,y) function in the (x,y)-plane. Matlab offers such function named as:
c
c
o
o
n
n
t
t
o
o
u
u
r
r. Experiment with the following code to see the usefulness of contour
plots.
Matlab’s command:
>> V=-10:1:10; [c,h] = contour(x,y,Z,V); clabel(c,h), colorbar; hold
on;
>> xlabel('x'); ylabel('y'); title('Contour plot of the peaks function');
Matlab’s response:
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-4
-3
-2
-1
0
1
2
3
4
x
y
Contour plot of the peaks function
-6
-5
-5
-4
-4
-3
-3
-3
-2
-2
-2
-2
-2
-1
-1
-1
-1
-1
-1
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
2
2
2
2
2
2
2
2
3
3
3
3
3
3
4
4
4
5
5
5
6
6
7
7
Local Minimum
Global Minimum
Local Maximum
Local Maximum
Global Maximum
-6
-4
-2
0
2
4
6
Komentarze do niniejszej Instrukcji