No BSD License  

Highlights from
RSA3000 TImed Sweep

RSA3000 TImed Sweep

by

 

22 Jun 2008 (Updated )

This program is designed to record a spectrum trace from a Tektronix RSA3000A/B at a fixed interval

elt=etime2(date1,date2)
function elt=etime2(date1,date2)
% ELT=ETIME2(DATE1,DATE2)
% Computes elapsed time DATE2-DATE1 in days, hours, minutes and seconds
%  DATE1 and DATE2 are in CLOCK format (datevector)
% Returns ELT, which has four elements:
%  [days hours minutes seconds]
% ETIME2 is only accurate to seconds (seconds value is rounded)
% ETIME2 is similar to the MATLAB built-in function ETIME;
%  ETIME2 handles the conversion from seconds to hours, days, etc.
%
% Example: To get the elapsed time in hours and minutes, use:
%
%     timestart=clock;
%
%     [... some commands ...]
%
%     timecheck=clock;
%     elapsedtime=etime2(timestart,timecheck);
%     % display elapsed time
%     fprintf(1,'Elapsed Time: %f:%f:%f:%f\n',...
%       elapsedtime(1) elapsedtime(2) elapsedtime(3) elapsedtime(4));
%
% M.A. Hopcroft
%      hopcroft@mems.stanford.edu
%
% MH MAY2006
% v1.0


% round to integers
date1=fix(date1);
date2=fix(date2);

% compute the total days for each time value
e1=datenum(date1);
e2=datenum(date2);
if e1 > e2
    error('etime2: date2 must be later than date1');
end

% elapsed time is the difference between the two
delta=e2-e1;

% return elapsed time
h=(delta-fix(delta))*24;
m=(h-fix(h))*60;
s=(m-fix(m))*60;
elt(1)=fix(delta);
elt(2)=fix(h); 
elt(3)=fix(m);
elt(4)=fix(s);

return

        
        

Contact us