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 edl_readctrlfile
Home > sltoolbox > ExpDL > edl_readctrlfile.m

edl_readctrlfile

PURPOSE ^

EDL_READCTRLFILE Reads in a control file

SYNOPSIS ^

function C = edl_readctrlfile(filename)

DESCRIPTION ^

EDL_READCTRLFILE Reads in a control file 

 $ Description $
   - C = edl_readctrlfile(filename)

 $ Arguments $
   - filename:     the filename of the control file
   - C:            the struct of the read information
                   - guid:    the GUID string     
                   - status:  the n x 1cell array of status

 $ Description $
   - C = edl_readctrlfile(filename) reads in a control file.

 $ History $
   - Created by Dahua Lin, on Aug 14, 2006

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function C = edl_readctrlfile(filename)
0002 %EDL_READCTRLFILE Reads in a control file
0003 %
0004 % $ Description $
0005 %   - C = edl_readctrlfile(filename)
0006 %
0007 % $ Arguments $
0008 %   - filename:     the filename of the control file
0009 %   - C:            the struct of the read information
0010 %                   - guid:    the GUID string
0011 %                   - status:  the n x 1cell array of status
0012 %
0013 % $ Description $
0014 %   - C = edl_readctrlfile(filename) reads in a control file.
0015 %
0016 % $ History $
0017 %   - Created by Dahua Lin, on Aug 14, 2006
0018 %
0019 
0020 %% Read in file
0021 
0022 doctag = 'ExpControl';
0023 nodetag = 'Entry';
0024 
0025 S = edl_readprops(filename, nodetag);
0026 
0027 %% Post-Processing
0028 
0029 % doc tag
0030 if ~strcmp(S.tag, doctag)
0031     error('edl:parseerror', ...
0032         'Invalid document tag %s for control file', S.tag);
0033 end
0034 
0035 % doc attribs
0036 if isempty(S.attribs)
0037     error('edl:parseerror', ...
0038         'The document element for control file has no attributes');
0039 end
0040 
0041 attrnames = {'guid'};
0042 tf = isfield(S.attribs, attrnames);
0043 if ~all(tf)
0044     error('edl:parserror', ...
0045         'The required header %s does not exist', ...
0046         attrnames{find(~tf, 1)});
0047 end
0048 
0049 C.guid = S.attribs.guid;
0050 
0051 % entries
0052 
0053 edl_check_internalindices(S.(nodetag));
0054 C.status = {S.(nodetag).status};
0055 C.status = C.status(:)';
0056 
0057 
0058

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

Contact us at files@mathworks.com