function c = lcm(a,b)
%LCM    Least common multiple.
%   LCM(A,B) is the least common multiple of corresponding elements of
%   A and B.  The arrays A and B must contain positive integers
%   and must be the same size (or either can be scalar).
%
%   See also GCD.

%   Copyright 1984-2000 The MathWorks, Inc. 
%   $Revision: 5.8 $  $Date: 2000/06/01 15:13:58 $

if any(round(a(:)) ~= a(:) | round(b(:)) ~= b(:) | a(:) < 1 | b(:) < 1)
    error('Input arguments must contain positive integers.');
end
c = a.*(b./gcd(a,b));
