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 detachfiles
Home > sltoolbox > fileio > @sllog > detachfiles.m

detachfiles

PURPOSE ^

DETACHFILES Detachs the logger from some added files

SYNOPSIS ^

function logger = detachfiles(logger, files)

DESCRIPTION ^

DETACHFILES Detachs the logger from some added files

 $ Syntax $
   - logger = detachfiles(logger, file)
   - logger = detachfiles(logger, files)

 $ Argument $
   - logger:       the logger to be processed
   - file:         the filename of the file to be detached
   - files:        the cell array of filenames to be detached

 $ Description $
   - logger = detachfiles(logger, file) detach a file from the logger
     list.

   - logger = detachfiles(logger, files) detach a set of filenames from
     the logger list.

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

CROSS-REFERENCE INFORMATION ^

This function calls:
  • detachfiles DETACHFILES Detachs the logger from some added files
  • isattached ISATTACHED Judges whether the file is attached to the logger
This function is called by:
  • detachfiles DETACHFILES Detachs the logger from some added files

SOURCE CODE ^

0001 function logger = detachfiles(logger, files)
0002 %DETACHFILES Detachs the logger from some added files
0003 %
0004 % $ Syntax $
0005 %   - logger = detachfiles(logger, file)
0006 %   - logger = detachfiles(logger, files)
0007 %
0008 % $ Argument $
0009 %   - logger:       the logger to be processed
0010 %   - file:         the filename of the file to be detached
0011 %   - files:        the cell array of filenames to be detached
0012 %
0013 % $ Description $
0014 %   - logger = detachfiles(logger, file) detach a file from the logger
0015 %     list.
0016 %
0017 %   - logger = detachfiles(logger, files) detach a set of filenames from
0018 %     the logger list.
0019 %
0020 % $ History $
0021 %   - Created by Dahua Lin, on Aug 12nd, 2006
0022 %
0023 
0024 if ischar(files)
0025         
0026     [tf, idx] = isattached(logger, files);
0027     if ~tf
0028         error('sltoolbox:invalidarg', ...
0029             'The file %s has not been added to the file list', fp);
0030     end
0031     
0032     fclose(files(idx).fid);
0033     
0034 elseif iscell(files)
0035     
0036     n = numel(files);
0037     for i = 1 : n
0038         logger = detachfiles(logger, files{i});
0039     end
0040     
0041 else
0042     error('sltoolbox:invalidarg', ...
0043         'The files should be either a filename or a cell array of filenames');
0044 end
0045     
0046     
0047

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

Contact us at files@mathworks.com