comparison m-toolbox/classes/@tsdata/fixNsecs.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % FIXNSECS fixes the numer of seconds.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: fixes the numer of seconds.
5 %
6 % CALL: d = fixNsecs(d)
7 %
8 % INPUT: d - tsdata object
9 %
10 % OUTPUT: d - tsdata object
11 %
12 % VERSION: $Id: fixNsecs.m,v 1.4 2011/02/18 16:48:55 ingo Exp $
13 %
14 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15
16 function varargout = fixNsecs(varargin)
17
18 obj = varargin{1};
19
20 %%% decide whether we modify the pz-object, or create a new one.
21 obj = copy(obj, nargout);
22
23 if isempty(obj.x)
24 obj.nsecs = length(obj.y)/obj.fs;
25 else
26 obj.nsecs = obj.x(end)-obj.x(1) + 1/obj.fs;
27 end
28
29 varargout{1} = obj;
30 end
31