Mercurial > hg > emotion-detection-top-level
diff Code/General/readValuesFromFile.m @ 4:92ca03a8fa99 tip
Update to ICASSP 2013 benchmark
author | Dawn Black |
---|---|
date | Wed, 13 Feb 2013 11:02:39 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Code/General/readValuesFromFile.m Wed Feb 13 11:02:39 2013 +0000 @@ -0,0 +1,21 @@ +function [ metrics, nanValues ] = readValuesFromFile( statsFileID, metricFileName, metricName ) + +FileID = fopen( metricFileName ); + +if( FileID <= 0 ) %does the file exist? + % if not + message = ['WARNING: MISSING ' metricName ' FILE']; + disp( message ); + fprintf( statsFileID, '\t \s missing', metricName ); + metrics=0; + nanValues=0; +else + metrics = fscanf( FileID, '%f', inf ); + % remove the frame numbers + metrics = metrics(2:2:end); + % remove all 'NaN' values + nanValues = isnan(metrics); + metrics = metrics(~(nanValues)); +% fprintf( statsFileID, '\t %f ', value ); + fclose( FileID ); +end \ No newline at end of file