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');
       tag         = get(ao, 'tag');
       provenance  = get(ao, 'provenance');
       comment     = get(ao, 'comment');
       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.9 2007/10/12 12:36:00 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 %       tag         = get(ao, 'tag');
0010 %       provenance  = get(ao, 'provenance');
0011 %       comment     = get(ao, 'comment');
0012 %       history     = get(ao, 'hist');
0013 %       data        = get(ao, 'data');
0014 %       mfile       = get(ao, 'mfile');
0015 %       amfilename  = get(ao, 'mfilename');
0016 %       mdlfile     = get(ao, 'mdlfile');
0017 %       mdlfilename = get(ao, 'mdlfilename');
0018 %       version     = get(ao, 'version');
0019 %       created     = get(ao, 'created');
0020 %       fs          = get(ao, 'fs');         --> ao.data.fs;
0021 %       t0          = get(ao, 't0');         --> ao.data.t0;
0022 %
0023 % The following call returns a parameter list object that contains the
0024 % default parameter values:
0025 %
0026 % >> pl = ao(ao, 'Params')
0027 %
0028 % VERSION: $Id: get.m,v 1.9 2007/10/12 12:36:00 ingo Exp $
0029 %
0030 % HISTORY: 30-01-07 M Hewitson
0031 %             Creation
0032 %
0033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0034 
0035 VERSION = '$Id: get.m,v 1.9 2007/10/12 12:36:00 ingo Exp $';
0036 
0037 % Check if this is a call for parameters or for the cvs-version number
0038 if nargin == 2
0039   if isa(ao, 'ao') && ischar(propName)
0040     in = char(propName);
0041     if strcmp(in, 'Params')
0042       val = getDefaultPL();
0043       return
0044     elseif strcmp(in, 'Version')
0045       val = VERSION;
0046       return
0047     end
0048   end
0049 end
0050 
0051 fields = fieldnames(ao);
0052 
0053 if ~ismember(propName, [fields; 'fs'; 't0'])
0054   error(['### ''' propName, ''' is not a valid analysis object property.']);
0055 else
0056 
0057   %%% Special case: If possible return the 'fs' property of the data object
0058   if strcmp(propName, 'fs')
0059     if isa(ao.data, 'tsdata') || isa(ao.data, 'fsdata')
0060       val = ao.data.fs;
0061     else
0062       error('### No ''fs'' property for this data type');
0063     end
0064 
0065   %%% Special case: If possible return the 't0' property of the data object
0066   elseif strcmp(propName, 't0')
0067 
0068     if isa(ao.data, 'tsdata')
0069       val = get(ao.data, 't0');
0070     else
0071       error('### The data object is not from the class tsdata');
0072     end
0073     
0074   %%% Return the property of the analysis object
0075   else
0076     val = ao.(propName);
0077   end
0078 end
0079 
0080 
0081 
0082 % Get default params
0083 function plo = getDefaultPL()
0084 
0085 plo = plist();

Generated on Thu 01-Nov-2007 09:42:34 by m2html © 2003