Transferral of search path to a new version

6 views (last 30 days)
Having now upped my license to 2015a, there should be a way to simply transfer the old (non-TMW supplied) search path to a new release.
Since for me, this involves adding several dozen of my own toolboxes, as well as a variety of those I have downloaded from the FEX, this is the hardest part.
I'd like to see an export external search path option, then an import external search path in the new release. It should be doable, in fact, I can see the way to write it if nobody has a better idea.
I'd write a simple gui tool, that would allow me to select a subset of the directories in my current searchpath, then export a file that contains that list. Then an import tool would read that file, and allow me to choose to add those directories to the top or bottom of my searchpath.
The problem here is when I install the new release, it won't have the import tool on my new search path. Still better than nothing, but this would be best if it was already in MATLAB. I don't see it in pathtool though.

Accepted Answer

John D'Errico
John D'Errico on 18 Mar 2015
Well, since nobody has answered this question, I'll post my own answer.
I've attached an m-file, called export_search_path.
- export_search_path extracts the non-matlabroot directories on your search path, then decides if they belong in the beginning or end of the new path in your new MATLAB release.
- It then writes out a .mat file into your current directory with a name that should not conflict with anything.
- Finally, it creates on the fly an m-file in that directory that you can run in the new MATLAB release.
When you open the new MATLAB release, you cd to the indicated directory, and run import_search_path. Executing that m-file will update the search path in your new release.
  2 Comments
John D'Errico
John D'Errico on 18 Mar 2015
I've not decided whether to post this as a submission on the File Exchange, as code that plays with your search path might be slightly dangerous in uneducated hands.

Sign in to comment.

More Answers (0)

Categories

Find more on Search Path in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!