GET get ao properties. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: GET get ao properties. CALL: name = get(ao, 'name'); provenance = get(ao, 'provenance'); description = get(ao, 'description'); history = get(ao, 'hist'); data = get(ao, 'data'); mfile = get(ao, 'mfile'); amfilename = get(ao, 'mfilename'); mdlfile = get(ao, 'mdlfile'); mdlfilename = get(ao, 'mdlfilename'); version = get(ao, 'version'); created = get(ao, 'created'); fs = get(ao, 'fs'); --> ao.data.fs; t0 = get(ao, 't0'); --> ao.data.t0; The following call returns a parameter list object that contains the default parameter values: >> pl = get(ao, 'Params') The following call returns a string that contains the routine CVS version: >> version = get(ao, 'Version') The following call returns a string that contains the routine category: >> category = get(ao, 'Category') VERSION: $Id: get.m,v 1.15 2008/02/13 07:58:13 mauro Exp $ HISTORY: 30-01-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function val = get(aos, propName) 0002 % GET get ao properties. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: GET get ao properties. 0007 % 0008 % CALL: name = get(ao, 'name'); 0009 % provenance = get(ao, 'provenance'); 0010 % description = get(ao, 'description'); 0011 % history = get(ao, 'hist'); 0012 % data = get(ao, 'data'); 0013 % mfile = get(ao, 'mfile'); 0014 % amfilename = get(ao, 'mfilename'); 0015 % mdlfile = get(ao, 'mdlfile'); 0016 % mdlfilename = get(ao, 'mdlfilename'); 0017 % version = get(ao, 'version'); 0018 % created = get(ao, 'created'); 0019 % fs = get(ao, 'fs'); --> ao.data.fs; 0020 % t0 = get(ao, 't0'); --> ao.data.t0; 0021 % 0022 % The following call returns a parameter list object that contains the 0023 % default parameter values: 0024 % 0025 % >> pl = get(ao, 'Params') 0026 % 0027 % The following call returns a string that contains the routine CVS version: 0028 % 0029 % >> version = get(ao, 'Version') 0030 % 0031 % The following call returns a string that contains the routine category: 0032 % 0033 % >> category = get(ao, 'Category') 0034 % 0035 % VERSION: $Id: get.m,v 1.15 2008/02/13 07:58:13 mauro Exp $ 0036 % 0037 % HISTORY: 30-01-07 M Hewitson 0038 % Creation 0039 % 0040 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0041 0042 VERSION = '$Id: get.m,v 1.15 2008/02/13 07:58:13 mauro Exp $'; 0043 CATEGORY = 'Helper'; 0044 DEFAULT_PLIST = plist('property', ''); 0045 0046 data_fields = ''; 0047 0048 if ~isempty(aos.data) 0049 data_fields = fieldnames(aos.data); 0050 end 0051 0052 %%% If prop_name is a plist then extrat the poperty name from the plist. 0053 if isa(propName, 'plist') 0054 propName = find(propName, 'property'); 0055 if isempty(propName) 0056 error ('### The plist does not contain the ''key'' = ''property'''); 0057 end 0058 end 0059 0060 %%% Special case: If possible return the 'fs' property of the data object 0061 if strcmp(propName, 'fs') 0062 if ismember('fs', data_fields) 0063 val = aos.data.fs; 0064 return 0065 else 0066 error('### ''fs'' is not a field of the data-property. The data-property is from the class [%s]', class(aos.data)); 0067 end 0068 0069 %%% Special case: If possible return the 't0' property of the data object 0070 elseif strcmp(propName, 't0') 0071 if ismember('t0', data_fields) 0072 val = aos.data.t0; 0073 return 0074 else 0075 error('### ''t0'' is not a field of the data-property. The data-property is from the class [%s]', class(aos.data)); 0076 end 0077 end 0078 0079 val = generic_get(aos, propName, DEFAULT_PLIST, VERSION, CATEGORY);