source: MML/trunk/applications/common/prependtimestamp.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 10 years ago

Initial import--MML version from SOLEIL@2013

File size: 729 bytes
Line 
1function FileName = prependtimestamp(FileName, TimeStamp)
2%PREPENDTIMESTAMP - Prepend the time stamp to a file
3%  FileName = prpendtimestamp(FileName, TimeStamp)
4%
5%  INPUTS
6%  1. FileName - Filename for appending timestamp
7%  2. TimeStamp - TimeStamp string
8%
9%  OUTPUTS
10%  1. FileName - File name modified
11%
12%  NOTES
13%  1. TimeStamp needs to by a vector as output by the Matlab clock function {Default: clock}
14%
15% See Also appendtimestamp
16
17%
18%  Written by Gregory Portmann
19
20if nargin < 1
21    error('At least 1 input required');
22end
23if nargin < 2
24    TimeStamp = clock;
25end
26
27% Append date_Time to FileName
28FileName = sprintf('%s_%s', datestr(TimeStamp,31), FileName);
29FileName(11) = '_';
30FileName(14) = '-';
31FileName(17) = '-';
Note: See TracBrowser for help on using the repository browser.