The solution is to ensure X, Y and G are all the same size. The meshgrid operation makes X and Y 100 x 100. The problem, then, is when you try to use contour, there is not a value in G for each X,Y pair.
The simplest way to do this is call the meshgrid function immediately after creating alpha and beta. That way, all the subsequent calculations are performed on the 100x100 variables, resulting in G being 100x100 as well.
[alpha,beta] = meshgrid(alpha,beta);