Mercurial > hg > emotion-detection-top-level
annotate Code/General/readManyValuesFromFile.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 [value] = readManyValuesFromFile( statsFileID, metricFileName, metricName, numberOfValuesPerFrame ) |
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 else |
Dawn@4 | 11 |
Dawn@4 | 12 value = fscanf( FileID, '%f', inf ); |
Dawn@4 | 13 value = buffer( value, numberOfValuesPerFrame + 1 ); % numberOfValuesPerFrame data values and one frame number |
Dawn@4 | 14 value = value( 2 : numberOfValuesPerFrame+1, : )'; % remove the frame numbers |
Dawn@4 | 15 fclose( FileID ); |
Dawn@4 | 16 end |