function theSlope=slope(x1,y1,x2,y2)
%slope return slope of line passing through two points
%
%consumes: x1, y1, x2, y2: scalar numbers
%produces: theSlope, a scalar number
%
%Examples:
%    >> slope(2,2,4,4)
%    ans = 1
%    >> slope(3,1,5,5)
%    ans = 2
%    >> slope(1,4,1,5)
%    Error: slope is undefined
%    >>
  
denom = x1 - x2;
num = y1 - y2;

if ( denom == 0 ) % <== fill in this line of code
  error('slope is undefined');
else
  theSlope = num/denom;
  return;
end

