Mercurial > hg > ishara
view general/fileutils/read.m @ 42:ae596261e75f
Various fixes and development to audio handling
author | samer |
---|---|
date | Tue, 02 Dec 2014 14:51:13 +0000 |
parents | e44f49929e56 |
children |
line wrap: on
line source
function M=read(name) % M=read(name): read and return ascii matrix file % name may be with or without .txt extension if name(end-3)~='.' name=[name '.txt']; end load('-ascii',name); last=max(findstr(name,'\')); if ~isempty(last) name=name(last+1:length(name)); end last=max(findstr(name,'/')); if ~isempty(last) name=name(last+1:length(name)); end if name(1)=='.' name=name(2:length(name)); end if name(1)>='0' & name(1)<='9' name=['X' name]; end dot=max(findstr(name,'.')); if ~isempty(dot) name=name(1:dot-1); end rr=findstr(name,'.'); name(rr)=repmat('_',1,length(rr)); rr=findstr(name,'&'); name(rr)=repmat('_',1,length(rr)); eval(['M=' name ';']);