SETTIME sets the time-vector of a tsdata object based on the length of the x vector and the sample rate. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: SETTIME sets the time-vector of a tsdata object based on the length of the x vector and the sample rate. CALL: tsdata = setTime(tsdata) VERSION: $Id: setTime.m,v 1.4 2007/07/18 13:58:45 ingo Exp $ HISTORY: 31-01-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function ts = setTime(ts) 0002 % SETTIME sets the time-vector of a tsdata object based on the length of the x vector and the sample rate. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: SETTIME sets the time-vector of a tsdata object based on the 0007 % length of the x vector and the sample rate. 0008 % 0009 % CALL: tsdata = setTime(tsdata) 0010 % 0011 % VERSION: $Id: setTime.m,v 1.4 2007/07/18 13:58:45 ingo Exp $ 0012 % 0013 % HISTORY: 31-01-2007 M Hewitson 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 ts.t = linspace(0, ts.nsecs-1/ts.fs, length(ts.x)); 0019 ts = reshapeT(ts); 0020 0021 % END