function cont = calc_cont_int(interval, varargin)
% CALC_CONT_INT finds a vector used to specify contour levels in CONTOUR.
%   cont = calc_cont_int(interval, varargin)
%   INTERVAL is a scalar for a contour interval and varargin contains any
%   number of arrays of values. CONT will be a vector covering the full
%   range of values in the arrays and can be used to specify a contour
%   interval in a call to contour or contourf.
%       EXAMPLE:
%   cont = calc_cont_int(0.25, rand(10), -rand(20))
%
% cont =
%  
%   Columns 1 through 7 
%  
%    -1.0000   -0.7500   -0.5000   -0.2500         0    0.2500    0.5000
%  
%   Columns 8 through 9 
%  
%     0.7500    1.0000

% $Id: calc_cont_int.m,v 1.1 1997/10/17 00:56:18 mansbrid Exp $
% Copyright J. V. Mansbridge, CSIRO, Fri Oct 17 11:52:21 EST 1997

if nargin < 2
  help calc_cont_in
  error('need at least 2 input arguments')
end

z = [];
for ii = 1:nargin - 1
  z = [z; varargin{ii}(:)];
end
cont = floor(min(z(:))/interval)*interval:interval: ...
	ceil(max(z(:))/interval)*interval;
