view m-toolbox/classes/@tsdata/fixNsecs.m @ 39:11e3ed9d2115 database-connection-manager

Implement databases listing in database connection dialog
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
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