Home > matlabmk > find_tpt.m

find_tpt

PURPOSE ^

function tpt=find_tpt(tme,tmes)

SYNOPSIS ^

function tpt=find_tpt(tme,tmes)

DESCRIPTION ^

function tpt=find_tpt(tme,tmes)

 Inputs:
   tme  - [scalar] a desired time
   tmes - a vector of times

 Output:
   tpt  - the element of tmes that is closest to tme in terms of absolute
          difference (L1 norm)

 Note: tme and tmes should be in the same units (e.g., milliseconds)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function tpt=find_tpt(tme,tmes)
0002 %function tpt=find_tpt(tme,tmes)
0003 %
0004 % Inputs:
0005 %   tme  - [scalar] a desired time
0006 %   tmes - a vector of times
0007 %
0008 % Output:
0009 %   tpt  - the element of tmes that is closest to tme in terms of absolute
0010 %          difference (L1 norm)
0011 %
0012 % Note: tme and tmes should be in the same units (e.g., milliseconds)
0013 
0014 [dummy tpt]=min(abs(tme-tmes));

Generated on Tue 10-May-2016 16:37:45 by m2html © 2005