Well what you really have is 2 points on 2 different lines and you want to find the intersection. The easiest way is to find the equations of the two lines and then calculate the intersection.
The equation of a line is given by y=mx+b where m is the slope and b is the y-intercept. For one line you have two points which gives two equations. So, you can solve for the constants m and b. This gives the following two equations
0=0*m+1*b % using the first point x=y=0 into y=m*x+b
6=6*m+1*b % using the second point x=y=6
or in matrix form
[ 0 ] = [ 0 1 ]* [ m ]
[ 6 ] [ 6 1 ] [ b ]
For the first line the constants can be calculated in MATLAB by
C1 = inv([0 1;6 1]*[1;0]; % m=C1(1) and b=C(2)
Now that you have the equation for the two lines you can solve for the intersection by solving the following system of equations (which are obtained by manipulating the equation for a line)
m_1*x-y = -b_1
m_2*x-y = -b_2
All that is left is to write the above system of equations in matrix form and solve
[x] = inv [m_1 -1] * [-b_1]
[y] [m_2 -1] [-b_2]
or in MATLAB syntax
I = inv(m_1 -1; m_2 -1]*[-b_1;-b_2]; % I is the intersection.
Notes
As per gnovice's comment if the the lines are actually line segments you need to check if the intersection is between the end points of the line segments
If the two slopes are equally, m_1=m_2 then there will either be no intersection or infinitely many intersections.