How to run two MATLAB instances simultaneously with different pathdef's?

妖精的绣舞 提交于 2019-12-03 17:17:22

Let me offer an alternative approach. It involves creating shortcuts inside the MATLAB IDE.

Simply create two shortcuts, each include something like:

addpath(genpath('/path/to/project_branch'))   %// add branch (and subfolders) to MATLAB path
cd('/path/to/project_branch')                 %// navigate to directory

(Explanation: The call to addpath will not save the changes system-wide, but will only persist for the current session, unless you call savepath)

Now whenever you start a new MATLAB session, and you decide to work on one or the other branch, simply click the corresponding shortcut and start hacking away...

Better yet, if you consider one branch as stable and the other as dev, you can add the stable one to the path permanently, and selectively add the development version on the top of the path addpath('...','-begin') using a shortcut, thus shadowing the other branch for the current session only.

yes, there is. Set the environment variable MATLABPATH before starting matlab (from a terminal)

export MATLABPATH=/yourdir
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!