MATLAB: How to measure angle between the lines

Image Processing Toolboxlines

I have plotted the lines with the following code.
x = [3 0];
y = [0 9];
line(x,y);
a = [1 2];
b = [0 3];
line(a,b);
axis([0 4 0 10]);
Now, how can I measure the angle between these lines?

Best Answer

diff = (atan((y(2)-y(1))/(x(2)-x(1))) - atan((b(2)-b(1))/(a(2)-a(1)))) * 180/pi;