Home > classes > @ao > get.m

get

PURPOSE ^

GET get ao properties.

SYNOPSIS ^

function val = get(ao, propName)

DESCRIPTION ^

 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 = ao(ao, 'Params')

 VERSION: $Id: get.m,v 1.10 2007/11/14 16:30:18 ingo Exp $

 HISTORY: 30-01-07 M Hewitson
             Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function val = get(ao, 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 = ao(ao, 'Params')
0026 %
0027 % VERSION: $Id: get.m,v 1.10 2007/11/14 16:30:18 ingo Exp $
0028 %
0029 % HISTORY: 30-01-07 M Hewitson
0030 %             Creation
0031 %
0032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0033 
0034 VERSION = '$Id: get.m,v 1.10 2007/11/14 16:30:18 ingo Exp $';
0035 
0036 % Check if this is a call for parameters or for the cvs-version number
0037 if nargin == 2
0038   if isa(ao, 'ao') && ischar(propName)
0039     in = char(propName);
0040     if strcmp(in, 'Params')
0041       val = getDefaultPL();
0042       return
0043     elseif strcmp(in, 'Version')
0044       val = VERSION;
0045       return
0046     end
0047   end
0048 end
0049 
0050 fields = fieldnames(ao);
0051 
0052 if ~ismember(propName, [fields; 'fs'; 't0'])
0053   error(['### ''' propName, ''' is not a valid analysis object property.']);
0054 else
0055 
0056   %%% Special case: If possible return the 'fs' property of the data object
0057   if strcmp(propName, 'fs')
0058     if isa(ao.data, 'tsdata') || isa(ao.data, 'fsdata')
0059       val = ao.data.fs;
0060     else
0061       error('### No ''fs'' property for this data type');
0062     end
0063 
0064   %%% Special case: If possible return the 't0' property of the data object
0065   elseif strcmp(propName, 't0')
0066 
0067     if isa(ao.data, 'tsdata')
0068       val = get(ao.data, 't0');
0069     else
0070       error('### The data object is not from the class tsdata');
0071     end
0072 
0073   %%% Return the property of the analysis object
0074   else
0075     val = ao.(propName);
0076   end
0077 end
0078 
0079 
0080 
0081 % Get default params
0082 function plo = getDefaultPL()
0083 
0084 plo = plist();

Generated on Tue 22-Jan-2008 10:39:13 by m2html © 2003