view 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
line wrap: on
line source
function [fileID,classID] = loadClassificationOutput(filename)

% Open raw file
fid = fopen(filename,'r');

% Read 1st line
tline = fgetl(fid);
fileID{1} = char(sscanf(tline, '%s\t%*s'));
classID{1} = char(sscanf(tline, '%*s\t%s'));

% Read rest of the lines
i=1;
while ischar(tline)
    i = i+1;
    tline = fgetl(fid);
    if (ischar(tline))
        
        fileID{i} = char(sscanf(tline, '%s\t%*s'));
        classID{i} = char(sscanf(tline, '%*s\t%s'));

    end;
end

% Close file
fclose(fid);