SETX sets the time-vector of a tsdata object based on the length of the x vector and the sample rate. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: SETX sets the time-vector of a tsdata object based on the length of the x vector and the sample rate. CALL: xydata = setTime(xydata) VERSION: $Id: setX.html,v 1.5 2007/11/07 20:58:37 hewitson Exp $ HISTORY: 31-01-07 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function ts = setX(ts) 0002 % SETX 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: SETX sets the time-vector of a tsdata object based on the 0007 % length of the x vector and the sample rate. 0008 % 0009 % CALL: xydata = setTime(xydata) 0010 % 0011 % VERSION: $Id: setX.html,v 1.5 2007/11/07 20:58:37 hewitson Exp $ 0012 % 0013 % HISTORY: 31-01-07 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