Mercurial > hg > emotion-detection-top-level
annotate 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 |
rev | line source |
---|---|
Dawn@4 | 1 function [ metrics, nanValues ] = readValuesFromFile( statsFileID, metricFileName, metricName ) |
Dawn@4 | 2 |
Dawn@4 | 3 FileID = fopen( metricFileName ); |
Dawn@4 | 4 |
Dawn@4 | 5 if( FileID <= 0 ) %does the file exist? |
Dawn@4 | 6 % if not |
Dawn@4 | 7 message = ['WARNING: MISSING ' metricName ' FILE']; |
Dawn@4 | 8 disp( message ); |
Dawn@4 | 9 fprintf( statsFileID, '\t \s missing', metricName ); |
Dawn@4 | 10 metrics=0; |
Dawn@4 | 11 nanValues=0; |
Dawn@4 | 12 else |
Dawn@4 | 13 metrics = fscanf( FileID, '%f', inf ); |
Dawn@4 | 14 % remove the frame numbers |
Dawn@4 | 15 metrics = metrics(2:2:end); |
Dawn@4 | 16 % remove all 'NaN' values |
Dawn@4 | 17 nanValues = isnan(metrics); |
Dawn@4 | 18 metrics = metrics(~(nanValues)); |
Dawn@4 | 19 % fprintf( statsFileID, '\t %f ', value ); |
Dawn@4 | 20 fclose( FileID ); |
Dawn@4 | 21 end |