Home > helper > copySample.m

copySample

PURPOSE ^

SYNOPSIS ^

function copySample()

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function copySample()
0002 
0003 fid = fopen('_sample/WBC_FP_PROBLEMS.txt');
0004 C = textscan(fid,'%u %s');
0005 headers = {'id','type'};
0006 S = cell2struct(C,headers,2);
0007 
0008 % Create folder if it's not already there
0009 types = unique(S.type);
0010 for t=1: length(types)
0011     if ~exist(strcat('_sample/FP/', char(types(t))),'dir')
0012         mkdir(strcat('_sample/FP/', char(types(t))));
0013     end
0014 end
0015 
0016 
0017 for i = 1: length(S.id)
0018    
0019    % construct name
0020    source = strcat('_sample/FP/FP_', num2str(S.id(i)),'.png');
0021    destination = strcat('_sample/FP/', char(S.type(i)),'/');
0022    % copy FP sample into category
0023    copyfile(source, destination);
0024    
0025    
0026     
0027 end
0028 
0029 
0030 end

Generated on Thu 17-Mar-2011 14:45:51 by m2html © 2005