%% Modulus and Phase of Hankel Function
% Generate the contour plots of the modulus and phase of the Hankel function H_0^{(1)}(z) [1 pg. 359].
% Create a grid of values for the domain.

[X,Y] = meshgrid(-4:0.002:2,-1.5:0.002:1.5);

%
% Calculate the Hankel function over this domain and generate the modulus contour plot.

H = besselh(0,X+1i*Y);
contour(X,Y,abs(H),0:0.2:3.2)
hold on

%
% In the same figure, add the contour plot of the phase.

contour(X,Y,rad2deg(angle(H)),-180:10:180)
hold off

% Copyright 2015 The MathWorks, Inc.