Home > classes > @tsdata > get.m

get

PURPOSE ^

GET get tsdata properties.

SYNOPSIS ^

function val = get(ts, propName)

DESCRIPTION ^

 GET get tsdata properties.

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

 DESCRIPTION: GET get tsdata properties.

 CALL:    name = get(ts, 'name');
            fs = get(ts, 'fs');
             x = get(ts, 'x');
             y = get(ts, 'y');
         nsecs = get(ts, 'nsecs');
            t0 = get(ts, 't0');
        xunits = get(ts, 'xunits');
        yunits = get(ts, 'yunits');
       created = get(ts, 'created');
       version = get(ts, 'version');

 VERSION: $Id: get.m,v 1.7 2007/11/13 16:03:20 ingo Exp $

 HISTORY: 30-01-07 M Hewitson
             Creation

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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function val = get(ts, propName)
0002 % GET get tsdata properties.
0003 %
0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0005 %
0006 % DESCRIPTION: GET get tsdata properties.
0007 %
0008 % CALL:    name = get(ts, 'name');
0009 %            fs = get(ts, 'fs');
0010 %             x = get(ts, 'x');
0011 %             y = get(ts, 'y');
0012 %         nsecs = get(ts, 'nsecs');
0013 %            t0 = get(ts, 't0');
0014 %        xunits = get(ts, 'xunits');
0015 %        yunits = get(ts, 'yunits');
0016 %       created = get(ts, 'created');
0017 %       version = get(ts, 'version');
0018 %
0019 % VERSION: $Id: get.m,v 1.7 2007/11/13 16:03:20 ingo Exp $
0020 %
0021 % HISTORY: 30-01-07 M Hewitson
0022 %             Creation
0023 %
0024 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0025 
0026 VERSION  = '$Id: get.m,v 1.7 2007/11/13 16:03:20 ingo Exp $';
0027 
0028 % Check if this is a call for parameters
0029 if nargin == 2
0030   if isa(ts, 'tsdata') && ischar(propName)
0031     in = char(propName);
0032     if strcmp(in, 'Params')
0033       val = plist;
0034       return
0035     elseif strcmp(in, 'Version')
0036       val = VERSION;
0037       return
0038     end
0039   end
0040 end
0041 
0042 switch propName
0043   case 'name'
0044     val = ts.name;
0045   case 'created'
0046     val = ts.created;
0047   case 'version'
0048     val = ts.version;
0049   case 'fs'
0050     val = ts.fs;
0051   case 'x'
0052     val = ts.x;
0053   case 'y'
0054     val = ts.y;
0055   case 'xunits'
0056     val = ts.xunits;
0057   case 'yunits'
0058     val = ts.yunits;
0059   case 'nsecs'
0060     val = ts.nsecs;
0061   case 't0'
0062     val = ts.t0;
0063   otherwise
0064     error([propName, ' is not a valid tsdata property.']);
0065 end

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