%This m-file (RTplot) plots the reflection and
%transmission of a barrier of length L and height V
%as a function of energy (in units of V).

%Define the barrier
L=1;
V=1;

%Define a vector with the energies
E=0.001:V/100:1.5*V;

%Define reflection (R) and transmission (T) vectors
%where of the same length as E with zeros

R=zeros(1,length(E));
T=R;

%Calculate the reflection and transmission for
%each energy

for count=1:length(E)
	[R(count) T(count)]=RTbarr(E(count),L,V);
end

%Clear the graph window
clf

%plot the reflection in red
plot(E,R,'r')

%hold the reflection, while plotting the transmission
hold

%plot the transmission i green
plot(E,T,'g')

%put in a grid to guide the eye
grid

%Finally mark the axis and put a title on the graph
xlabel('Energy of incoming particles in units of V (E/V)')
ylabel('Reflection (red) and transmission (green)')
title('R and T of a barrier as a function energy. L=5')
