tomwalters@0: % tool tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % bleeck@3: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function is_there=fexist(datei) tomwalters@0: %usage: is_there=fexist(datei) tomwalters@0: % returns a boolean (1 or 0) whether the requested datei exist or not tomwalters@0: tomwalters@0: is_there=0; tomwalters@0: tomwalters@0: tomwalters@0: try tomwalters@0: nr=exist(datei); tomwalters@0: catch tomwalters@0: is_there=0; tomwalters@0: return; tomwalters@0: end tomwalters@0: tomwalters@0: % is a normal file: tomwalters@0: if nr==2 tomwalters@0: is_there=1; tomwalters@0: return; tomwalters@0: end tomwalters@0: tomwalters@0: % is a directory: tomwalters@0: if nr==7 tomwalters@0: is_there=1; tomwalters@0: return; tomwalters@0: end tomwalters@0: tomwalters@0: tomwalters@0: % tomwalters@0: % tomwalters@0: % FID = -1; tomwalters@0: % FID = fopen(datei,'r'); tomwalters@0: % if FID ~=-1 tomwalters@0: % is_there=1; tomwalters@0: % fclose(FID); tomwalters@0: % return tomwalters@0: % end tomwalters@0: % tomwalters@0: % % if still here, it can be a directory tomwalters@0: % % try to find the name in the list tomwalters@0: % dir_struct = dir; tomwalters@0: % [sorted_names,sorted_index] = sortrows({dir_struct.name}'); tomwalters@0: % tomwalters@0: % for i=1:length(sorted_index) tomwalters@0: % if strcmp(sorted_names(i),datei) tomwalters@0: % is_there=1; tomwalters@0: % return tomwalters@0: % end tomwalters@0: % end tomwalters@0: % is_there=0; tomwalters@0: %