Mercurial > hg > ltpda
diff m-toolbox/classes/+utils/@prog/get_curr_m_file_path.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/+utils/@prog/get_curr_m_file_path.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,21 @@ +function pth = get_curr_m_file_path (m_file_name) +% 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.1 2008/06/18 13:35:11 hewitson Exp $ +% +% HISTORY: 25-06-07 Diepholz +% Creation +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +pth = ''; +eval (sprintf('pth = which(''%s'');',m_file_name)) +index = find(pth==filesep, 1, 'last'); +pth = pth(1:index); \ No newline at end of file