diff m-toolbox/classes/@tsdata/growT.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/@tsdata/growT.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,28 @@
+% GROWT grows the time (x) vector if it is empty.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% DESCRIPTION: GROWT grows the time (x) vector if it is empty.
+%
+% CALL:        d    = growT(d)
+%
+% INPUT:       d - tsdata object
+%
+% OUTPUT:      d - tsdata object
+%
+% VERSION:     $Id: growT.m,v 1.5 2011/02/18 16:48:55 ingo Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+function varargout = growT(varargin)
+
+  d = varargin{1};
+
+  %%% decide whether we modify the pz-object, or create a new one.
+  d = copy(d, nargout);
+
+  % Grow the time vector
+  d.setX(linspace(0, d.nsecs-1/d.fs, d.nsecs*d.fs));
+
+  varargout{1} = d;
+end
+