Back to home page

MITgcm

 
 

    


Warning, /utils/matlab/Graphix/GraphixUtility/AddSlashesBeforeUnderscores.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit 892fe9e2 on 2005-10-19 20:09:14 UTC
892fe9e2f3 Dani*0001 function string = AddSlashesBeforeUnderscores(str)
                0002 
                0003 index = find(str == '_');
                0004 
                0005 if ~isempty(index)
                0006         string = '';
                0007         for ichar = 1:length(index)
                0008         
                0009         if ichar == 1
                0010             i = 1;
                0011         else
                0012             i = index(ichar-1);
                0013         end
                0014         
                0015         string = [string,str(i:index(ichar)-1),'\'];
                0016         end
                0017     
                0018         string = [string,str(index(ichar):end)];
                0019     
                0020 else
                0021     string = str;
                0022     
                0023 end