Code covered by the BSD License  

Highlights from
Avantes to Matlab

image thumbnail

Avantes to Matlab



11 Jun 2012 (Updated )

Read spectral data from Avantes USB2 spectrometer files

function savelogfile
% Saves global logString to a file with the current timestamp as the name.
% This is my experimental attempt to implement logging.
% Copyright (cc-by) K. Karapetyan,, 2011.

global logString

timestamp = datestr(now, 'yymmdd_HHMMSS');

if ~isempty(logString)
    logFileName = ['log_' timestamp '.txt'];
    f = fopen(logFileName, 'w');
    fprintf(f, '%s', logString);
    fprintf('Log saved to %s\n', logFileName);

clear global logString

Contact us