Saturday, 15 March 2014

arrays - How to assign different labels to a set of classes using Matlab? -



arrays - How to assign different labels to a set of classes using Matlab? -

can guide me in best possible way using matlab.

i have files names 001_g_01.sig...001_g_08.sig, 002_g_01.sig...002_g_010.sig, 003_g_01.sig...003_g_08, upto n files. want assigning labels files belong 1 user (i.e.001_g_01.sig...001_g_08.sig "user1", 002_g_01.sig...002_g_010.sig "user2" , on).

i have next code read files.

dirname= '/folderpath'; files = dir( fullfile(dirname,'001_g_1.sig') ); files = {files.name}; dirname1= '/folderpath'; files1 = dir( fullfile(dirname1,'*.sig') ); files1 = {files1.name}; i=1:length(files) fname = fullfile(dirname,files{i}); %# calculation j=i+1:length(files1) fname1 = fullfile(dirname1,files1{j}); %# calculation end end

files1 = '001_g_01.sig' '001_g_08.sig' '003_g_01.sig' . .

if files1 cell above, can write:

userlabel = {'001','002','003'}; f = cellstr(files1); ii = 1:3 result{ii} = strncmp(userlabel(ii),f,3); end

arrays matlab label

No comments:

Post a Comment