view m-toolbox/classes/@tsdata/fixNsecs.m @ 43:bc767aaa99a8
CVS Update
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Tue, 06 Dec 2011 11:09:25 +0100 (2011-12-06)
parents
f0afece42f48
children
line source
+ − % FIXNSECS fixes the numer of seconds.
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ − %
+ − % DESCRIPTION: fixes the numer of seconds.
+ − %
+ − % CALL: d = fixNsecs(d)
+ − %
+ − % INPUT: d - tsdata object
+ − %
+ − % OUTPUT: d - tsdata object
+ − %
+ − % VERSION: $Id: fixNsecs.m,v 1.4 2011/02/18 16:48:55 ingo Exp $
+ − %
+ − %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ −
+ − function varargout = fixNsecs(varargin)
+ −
+ − obj = varargin{1};
+ −
+ − %%% decide whether we modify the pz-object, or create a new one.
+ − obj = copy(obj, nargout);
+ −
+ − if isempty(obj.x)
+ − obj.nsecs = length(obj.y)/obj.fs;
+ − else
+ − obj.nsecs = obj.x(end)-obj.x(1) + 1/obj.fs;
+ − end
+ −
+ − varargout{1} = obj;
+ − end
+ −