Professional Documents
Culture Documents
Optimal Control Assignment 01
Optimal Control Assignment 01
ASSIGNMENT 01
MATLAB CODE
x1=-2:0.1:2;
x2=-2:0.1:2;
[X,Y] = meshgrid(x1,x2);
fx=X.^2 + (Y.^2)/4;
contour(X,Y,fx)
%contour(X,Y,fx,'ShowText','on')
CONTOUR PLOTS
2
1.5
1
0.5
0
-0.5
-1
-1.5
-2
-2
-1.5
-1
-0.5
0.5
1.5
1.5
-1
-0.5
0
0.5
1
2.5
3
3.5
4
4.5
1.5
-1.5
2
2.5
3
3.5
4
4.5
-1.5
1
2
2.5
3
3.5
4
1.5
0.5
0.5
1.5
4.5
4
3.5
3
0
2.5
2
-0.5
0.5
1.5
2
2.5
3
3.5
4
-2
-2
1
1
0.5
1.5
0.5
1
1.5
4.5
4
3.5
3
2.5
2
2
1
-1
0.5
1.5
2