User1551892
User1551892

Reputation: 3364

How to get the list of Matlab saved setpath?

I have more than 30 save setpath in Matlab and I want to remove them first and test something and later on, I want to add them back. What would be optimized way of achieving this. Is there a method to get the list of saved setpath and later on add paths in setpath by providing a list. I tried getnpath and it returns the matlab toolboxes path.

Upvotes: 1

Views: 246

Answers (1)

Divakar
Divakar

Reputation: 221584

Create a backup of paths in a mat file -

path_list = path;
save('paths.mat','path_list');

Do your thing of removing 30 saved paths by going to Set Path option on the File menu and do whatever testing you were looking to do.

Once done with the testing, now you wish to add back the deleted paths. So restore the paths from the backed up mat file -

load('paths.mat')
path(path_list)

Upvotes: 1

Related Questions