function v = vectorize(s)
%VECTORIZE Vectorize expression.
%   VECTORIZE(S), when S is a string expression, inserts a '.' before
%   any '^', '*' or '/' in S.  The result is a character string.
%
%   VECTORIZE(FCN), when FCN is an INLINE function object, vectorizes the
%   formula for FCN.  The result is the vectorized version of the INLINE
%   function.
%
%   See also INLINE/FORMULA, INLINE.

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.4 $  $Date: 1997/11/21 23:31:15 $

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