Salman Azmat
Salman Azmat

Reputation: 298

How to change the MATLAB path back to the default?

I was trying to add a toolbox in MATLAB and instead of calling addpath('path'), I called path('path').

Now I'm getting a lot of errors, like

if I initialize a variable, I get

Error using eval. Undefined function 'workspacefunc' for input arguments of type struct

Is there anyway I can restore the default MATLAB path/paths ?

Upvotes: 2

Views: 5995

Answers (2)

Eli_B
Eli_B

Reputation: 175

I had a similar situation where on startup, on Windows 8.1 64-bit, Matlab R2014b would show the same error and then no function would work. In my case, restoredefaultpathcouldn't be found.

Setting the UserPath in the matlab setting file as suggested elsewhere also didn't help.

The solution was to remove the environment variable MATLABPATH that I had set as a convenience while trying to compile against Matlab libraries.

The error message could be more helpful...

Upvotes: 0

paisanco
paisanco

Reputation: 4164

Use the MATLAB command

restoredefaultpath

to restore the MATLAB search path to the state at startup.

See MATLAB documentation for restoredefaultpath here

Upvotes: 3

Related Questions