Matlab addpath() does not stick on the path when current directory is changed? -
i have matlab_xunit, folder bunch of functions used writing unit tests. it's stored in ../external/matlab_xunit. want call runtests part of package. here sample code:
addpath(genpath('../external/matlab_xunit')) runtests subdirectory
subdirectory sub-directory of current directory. runtests change current directory subdirectory, , find tests in folder , run tests. problem is, found out, current directory gets changed, matlab_xunit no longer on path. thus, functions runtests has call inside become invalid - 'vanish'.
anyway around shortcoming of addpath()?
thanks much!
use full path. work:
addpath(genpath(fullfile(pwd,'../external/matlab_xunit')))
Comments
Post a Comment