setting a default matlab path at startup

后端 未结 2 1589
遥遥无期
遥遥无期 2021-01-26 22:00

My team is trying to standardise our Matlab paths so that everyone has the same.

I have a list of the default matlab path that we should all have.

So we would l

相关标签:
2条回答
  • 2021-01-26 22:44

    Include a path or addpath line in file startup.m. For example, to add folder aaa\bbb to the path the line would be

    addpath('aaa\bbb')
    

    Note that each user may have a different startup.m file. You may need to create it, if it doesn't already exist.

    0 讨论(0)
  • 2021-01-26 22:48

    You can change which directory MATLAB starts in using the userpath function so that whenever you start up MATLAB, the path will automatically redirect here.

    This may be useful if you have MATLAB running on a network per se, and multiple instances can start in the same network directory.

    See more from MathWorks here: http://www.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html


    However, if you want to standardize everything so that everyone has access to the same path, you can use startup to add directories / folders to MATLAB's path, but if you want to complete the package, use userpath to get MATLAB to start at a specified directory.

    Your startup.m file may look something like this:

    addpath('/folder/to/add/one');
    addpath('/folder/to/add/two');
    addpath('/folder/to/add/three');
    addpath('/folder/to/add/four');
    

    Then set your userpath with the function to complete everything:

    userpath('/folder/to/start');
    addpath('/folder/to/start');
    

    Also make sure you add this new folder to your startup.m file too.

    0 讨论(0)
提交回复
热议问题