GET_CURR_M_FILE_PATH returns the path for a mfile. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: GET_CURR_M_FILE_PATH returns the path for a mfile. CALL: path = get_curr_m_file_path(mfilename) path = get_curr_m_file_path('explore_ao') VERSION: $Id: get_curr_m_file_path.m,v 1.2 2007/06/25 11:21:48 ingo Exp $ HISTORY: 25-06-07 Diepholz Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 function pth = get_curr_m_file_path (m_file_name) 0002 % GET_CURR_M_FILE_PATH returns the path for a mfile. 0003 % 0004 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0005 % 0006 % DESCRIPTION: GET_CURR_M_FILE_PATH returns the path for a mfile. 0007 % 0008 % CALL: path = get_curr_m_file_path(mfilename) 0009 % path = get_curr_m_file_path('explore_ao') 0010 % 0011 % VERSION: $Id: get_curr_m_file_path.m,v 1.2 2007/06/25 11:21:48 ingo Exp $ 0012 % 0013 % HISTORY: 25-06-07 Diepholz 0014 % Creation 0015 % 0016 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0017 0018 pth = ''; 0019 eval (sprintf('pth = which(''%s'');',m_file_name)) 0020 index = find(pth==filesep, 1, 'last'); 0021 pth = pth(1:index);