% Book: Laser Electronics by Verdeyen
% Problem: Chapter 3 problem 6
% Script Author: meg noah meg_noah@student.uml.edu
function Lasers_Ch3_Pr6
figure(1);true;
axis([-2 2 -2 2]);
[X,Y] = meshgrid(-2:.2:2);
R2 = X.^2+Y.^2
DX=Y.*exp(-R2);
DY=X.*exp(-R2);
Z = DX.^2+DY.^2;
contourf(X,Y,Z)
hold on
quiver(X,Y,DX,DY)
colormap hsv
grid off
hold off
