function rng=adi_lim_eval(rng_lims);
% Call rng=adi_lim_eval(rng_lims)
%
% rng_lims	= [r1,r2,nr]	 ==> 	rng=linspace(r1,r2,nr)', OR
%			  [r1;r2; ...rn] ==> 	[r1;r2; ...rn]; OR
%			  [r1,r2,-dr]	 ==> 	rng=[r1:dr:r2]';
%             []             ==>    rng=[];
%
[nr,nc]=size(rng_lims);
if nr==1 & nc==3,
	if rng_lims(3)>0,
		rng=linspace(rng_lims(1),rng_lims(2),rng_lims(3))'; 
	else
		rng=[rng_lims(1):-rng_lims(3):rng_lims(2)]';
	end
elseif nr==1 & nc==2,
	rng=rng_lims;
elseif nc==1,
	rng=rng_lims;
elseif isempty(rng_lims),
	rng=[];
else
	error(['USER ERROR: lims must be in form [r1,r2,nr], ',...
	 '[r1,r2,-dr] or [r1;r2;...rn].'])
end
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
