function loc = nir_cmd

% nir_cmd - get location of nircmp helper
% ---------------------------------------
%
% loc = nir_cmd
% 
% Output:
% -------
%  loc - full pathname of helper

%--------------------------------
% Author: Harold Figueroa
%--------------------------------
% $Revision: 1180 $
% $Date: 2005-07-15 17:22:21 -0400 (Fri, 15 Jul 2005) $
%--------------------------------

%--
% create and return persistent location
%-

% NOTE: this assumes helper is in matlab path

persistent NIRCMD_LOC; 

if (isempty(NIRCMD_LOC))
	NIRCMD_LOC = which('nircmd.exe');
end 

% NOTE: apparently we can't return persistent variable

loc = NIRCMD_LOC;