SUBSREF Define field name indexing for time objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: SUBSREF Define field name indexing for time objects. EXAMPLES: All possible accesses are possible. VERSION: $Id: subsref.m,v 1.6 2007/08/14 09:17:03 ingo Exp $ HISTORY: 31-01-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function B = subsref(A, S) 0002 % SUBSREF Define field name indexing for time objects. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: SUBSREF Define field name indexing for time objects. 0007 % 0008 % EXAMPLES: All possible accesses are possible. 0009 % 0010 % VERSION: $Id: subsref.m,v 1.6 2007/08/14 09:17:03 ingo Exp $ 0011 % 0012 % HISTORY: 31-01-07 M Hewitson 0013 % Creation 0014 % 0015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0016 0017 B = builtin('subsref', A, S); 0018 0019 % function varargout = subsref(tt, index) 0020 % % SUBSREF Define field name indexing for time objects. 0021 % % 0022 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0023 % % 0024 % % DESCRIPTION: SUBSREF Define field name indexing for time objects. 0025 % % 0026 % % EXAMPLES: 0027 % % nesting level == 1 0028 % % >> x = time.format_string; 0029 % % ... 0030 % % 0031 % % VERSION: $Id: subsref.m,v 1.6 2007/08/14 09:17:03 ingo Exp $ 0032 % % 0033 % % HISTORY: 23-07-2007 Diepholz 0034 % % Creation 0035 % % 0036 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0037 % 0038 % switch length(index) 0039 % case 1 0040 % switch index.type 0041 % 0042 % % INFO: time(1) not possible 0043 % % INFO: time(1:3) not possible 0044 % % INFO: time(2,1) not possible 0045 % case '()' 0046 % error ('this indexing method () is not allowd.') 0047 % if length (index.subs) == 1 0048 % else % length (index.subs) == 2 0049 % end 0050 % 0051 % % INFO: time.xxx; 0052 % % ... 0053 % case '.' 0054 % fieldName = index.subs; 0055 % eval(sprintf('varargout{1} = tt.%s;', fieldName)); 0056 % 0057 % otherwise 0058 % error('### unknown indexing method for time objects.'); 0059 % end 0060 % 0061 % otherwise 0062 % error('### unknown indexing method for tsdata objects.'); 0063 % end 0064 % 0065 % % END 0066 %