function flag = nntwarn(cmd)
%NNTWARN
%
%  Syntax
%
%    nntwarn on
%    nntwarn off
%
%  Description
%
%    NNTWARN allows Shallow Neural Network warnings in Deep Learning 
%    Toolbox to be temporarily turned off.
%
%    Code using obsolete Shallow Neural Network functionality can
%    generate a lot of warnings.  This function allows you to skip
%    those warnings.  However, we encourage you to update your code
%    to ensure that it will run under future versions of the toolbox.

% Mark Beale, 11-31-97
% Copyright 1992-2018 The MathWorks, Inc.

if nargin < 1, error(message('nnet:Args:NotEnough')),end

persistent NNTWARNFLAG;

switch(lower(cmd))
  case 'on'
    NNTWARNFLAG = [];
  case 'off'
    NNTWARNFLAG = 'off';
  case 'error'
    NNTWARNFLAG = 'error';
  case 'query'
    flag = NNTWARNFLAG;
  otherwise
    error(message('nnet:Args:Unrec'))
end

