Mercurial > hg > dcase2013_ed_vuegenetal
comparison functions/funcsMobilab/find_format.m @ 0:2fadb31a9d55 tip
Import code by Vuegen et al
author | Dan Stowell <dan.stowell@elec.qmul.ac.uk> |
---|---|
date | Fri, 11 Oct 2013 12:02:43 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:2fadb31a9d55 |
---|---|
1 function [files] = find_format(DIR,format) | |
2 | |
3 i = 1; | |
4 inhoud_DIR = dir(DIR); | |
5 aantal_bestanden = length(inhoud_DIR); | |
6 for j = 1:aantal_bestanden | |
7 bestandsnaam = inhoud_DIR(j,1).name; | |
8 if strcmp(format,'map') | |
9 if inhoud_DIR(j,1).isdir ==true | |
10 if bestandsnaam(1) ~= '.' | |
11 files.labels(i) = {bestandsnaam(1:(length(bestandsnaam)-length('01.wav')))}; | |
12 files.names(i) = {bestandsnaam}; | |
13 i = i+1; | |
14 end | |
15 end | |
16 else | |
17 if length(bestandsnaam)>=length(format), | |
18 formaatBestandsnaam = bestandsnaam(end-length(format)+1:end); | |
19 if strcmp(formaatBestandsnaam, char(ones(1,0))); | |
20 formaatBestandsnaam = ''; | |
21 end | |
22 if strcmp(formaatBestandsnaam, format), | |
23 files.labels(i) = {bestandsnaam(1:(length(bestandsnaam)-length('01.wav')))}; | |
24 files.names(i) = {bestandsnaam}; | |
25 i = i+1; | |
26 end | |
27 end | |
28 end | |
29 end |