annotate scene_classification/loadClassificationOutput.m @ 10:507300d2ed66 tip

merge
author Dan Stowell <dan.stowell@elec.qmul.ac.uk>
date Thu, 10 Oct 2013 09:18:47 +0100
parents dcaf371d33e3
children
rev   line source
emmanouil@0 1 function [fileID,classID] = loadClassificationOutput(filename)
emmanouil@0 2
emmanouil@0 3 % Open raw file
dan@2 4 fid = fopen(filename,'r');
emmanouil@0 5
emmanouil@0 6 % Read 1st line
emmanouil@0 7 tline = fgetl(fid);
emmanouil@0 8 fileID{1} = char(sscanf(tline, '%s\t%*s'));
emmanouil@0 9 classID{1} = char(sscanf(tline, '%*s\t%s'));
emmanouil@0 10
emmanouil@0 11 % Read rest of the lines
emmanouil@0 12 i=1;
emmanouil@0 13 while ischar(tline)
emmanouil@0 14 i = i+1;
emmanouil@0 15 tline = fgetl(fid);
emmanouil@0 16 if (ischar(tline))
emmanouil@0 17
emmanouil@0 18 fileID{i} = char(sscanf(tline, '%s\t%*s'));
emmanouil@0 19 classID{i} = char(sscanf(tline, '%*s\t%s'));
emmanouil@0 20
emmanouil@0 21 end;
emmanouil@0 22 end
emmanouil@0 23
emmanouil@0 24 % Close file
emmanouil@0 25 fclose(fid);
emmanouil@0 26