clf

subplot(2,1,1)
plot(nLambda,abs(die(freqSlice)./inc(freqSlice)));
grid on
xlabel('Points per Wavelength', 'Interpreter', 'latex');
ylabel('$|E^t_z(x_1,\omega)/E^i_z(x_1,\omega)|$', ...
   'Interpreter', 'latex');
title('(a) Normalized Transmitted Field vs. Discretization', ...
   'Interpreter', 'latex');
axis([0 300 0 1])

% Exponential has to be transposed to an array conformal with others.                         
% Simply using ' (a prime) for transposition will yield the conjugat                          
% transpose.  Instead have to use .' (dot-prime) to get                                       
% transposition without conjugation.                                                          
subplot(2,1,2)
hold on
plot(nLambda, ...
   real(exp(j*pi*freqIndex/25.6).'.*die(freqSlice)./inc(freqSlice)));
plot(nLambda, ...
   imag(exp(j*pi*freqIndex/25.6).'.*die(freqSlice)./inc(freqSlice)),'-.');
grid on
xlabel('Points per Wavelength', 'Interpreter', 'latex');
ylabel('Transmission Coefficient $T(\omega)$', ...
   'Interpreter', 'latex');
title('(b) Real and Imaginary Part of Transmission Coefficient', ...
   'Interpreter', 'latex');
legend('Real part','Imaginary part', 'Interpreter', 'latex');
axis([0 300 -1 1])
grid on
