Code covered by the BSD License  

Highlights from
Statistical Learning Toolbox

from Statistical Learning Toolbox by Dahua Lin
Functions for statistical learning, pattern recognition and computer vision, covering many topics.

Description of setactive
Home > sltoolbox > fileio > @sllog > setactive.m

setactive

PURPOSE ^

SETACTIVE Sets a set of files active/inactive

SYNOPSIS ^

function logger = setactive(logger, files, s)

DESCRIPTION ^

SETACTIVE Sets a set of files active/inactive

 $ Syntax $
   - logger = setactive(logger, file, s)
   - logger = setactive(logger, files, s)

 $ Description $
   - logger = setactive(logger, file, s) sets the state of the specified
     file in the logger to be s (true/false).

   - logger = setactive(logger, file, s) sets the state of the specified
     cell array of files in the logger to be s (true/false).

 $ History $
   - Created by Dahua Lin, on Aug 12nd, 2006

CROSS-REFERENCE INFORMATION ^

This function calls:
  • isattached ISATTACHED Judges whether the file is attached to the logger
  • setactive SETACTIVE Sets a set of files active/inactive
This function is called by:
  • setactive SETACTIVE Sets a set of files active/inactive

SOURCE CODE ^

0001 function logger = setactive(logger, files, s)
0002 %SETACTIVE Sets a set of files active/inactive
0003 %
0004 % $ Syntax $
0005 %   - logger = setactive(logger, file, s)
0006 %   - logger = setactive(logger, files, s)
0007 %
0008 % $ Description $
0009 %   - logger = setactive(logger, file, s) sets the state of the specified
0010 %     file in the logger to be s (true/false).
0011 %
0012 %   - logger = setactive(logger, file, s) sets the state of the specified
0013 %     cell array of files in the logger to be s (true/false).
0014 %
0015 % $ History $
0016 %   - Created by Dahua Lin, on Aug 12nd, 2006
0017 %
0018 
0019 if ischar(files)
0020         
0021     [tf, idx] = isattached(logger, files);
0022     
0023     if tf
0024         logger.files(idx).isactive = s;
0025     else
0026         error('sltoolbox:invalidarg', ...
0027             'The file %s has not been added to the file list', files);
0028     end
0029     
0030 elseif iscell(files)
0031     
0032     n = length(files);
0033     for i = 1 : n
0034         logger = setactive(logger, files{i}, s);
0035     end
0036     
0037 else
0038     
0039     error('sltoolbox:invalidarg', ...
0040         'The files should be a string or a cell array');
0041 end
0042 
0043

Generated on Wed 20-Sep-2006 12:43:11 by m2html © 2003

Contact us at files@mathworks.com