Home > classes > @provenance > subsref.m

subsref

PURPOSE ^

SUBSREF Define field name indexing for provenance objects.

SYNOPSIS ^

function varargout = subsref(p, index)

DESCRIPTION ^

 SUBSREF Define field name indexing for provenance objects.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: SUBSREF Define field name indexing for provenance objects.

 EXAMPLES:

  nesting level == 1

    >>  creator         = p.creator;
    >>  created         = p.created;
    >>  ip              = p.ipaddress;
    >>  hostname        = p.hostname;
    >>  os              = p.os;
    >>  matlab_version  = p.matlab_version;
    >>  sigproc_version = p.sigproc_version;
    >>  ltpda_version   = p.ltpda_version;

 VERSION: $Id: subsref.m,v 1.1 2007/06/14 14:30:28 ingo Exp $

 HISTORY: 14-06-07 Diepholz
             Creation
  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function varargout = subsref(p, index)
0002 % SUBSREF Define field name indexing for provenance objects.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: SUBSREF Define field name indexing for provenance objects.
0007 %
0008 % EXAMPLES:
0009 %
0010 %  nesting level == 1
0011 %
0012 %    >>  creator         = p.creator;
0013 %    >>  created         = p.created;
0014 %    >>  ip              = p.ipaddress;
0015 %    >>  hostname        = p.hostname;
0016 %    >>  os              = p.os;
0017 %    >>  matlab_version  = p.matlab_version;
0018 %    >>  sigproc_version = p.sigproc_version;
0019 %    >>  ltpda_version   = p.ltpda_version;
0020 %
0021 % VERSION: $Id: subsref.m,v 1.1 2007/06/14 14:30:28 ingo Exp $
0022 %
0023 % HISTORY: 14-06-07 Diepholz
0024 %             Creation
0025 %
0026 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0027 
0028 switch length(index)
0029   case 1
0030     switch index.type
0031 
0032       % INFO: p = p(2) not possible
0033       case '()'
0034         error('### the ''()'' indexing is not supported. IF it is necessary code me up');
0035 
0036       % INGO: creator = p.creator;
0037       %       created = p.created;
0038       %       ip      = p.ipaddress;
0039       %              ...
0040       case '.'
0041         fieldName = index.subs;
0042         eval(sprintf('varargout{1} = p.%s;', fieldName));
0043 
0044       otherwise
0045         error('### only ''.'' indexing method for provenance objects is allowed.');
0046     end
0047   otherwise
0048     error('### nesting level for provenance objects is too large.');
0049 end
0050 
0051 % END
0052

Generated on Wed 04-Jul-2007 19:03:10 by m2html © 2003