function fcn = vectorize(fcn)
%VECTORIZE Vectorize an INLINE function object.
%   VECTORIZE(FCN) inserts a '.' before any '^', '*' or '/' in the formula
%   for FCN.  The result is the vectorized version of the INLINE fuction.
%
%   See also INLINE/FORMULA, INLINE.

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.2 $  $Date: 1997/11/21 23:30:37 $

v = fcn.expr;
for k = fliplr(find((v=='^') | (v=='*') | (v=='/')))
   v = [v(1:k-1) '.' v(k:end)];
end
fcn.expr = v;
