2

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 ?

HaveNoDisplayName
  • 8,291
  • 106
  • 37
  • 47
Salman Azmat
  • 298
  • 6
  • 18

2 Answers2

3

Use the MATLAB command

restoredefaultpath

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

See MATLAB documentation for restoredefaultpath here

paisanco
  • 4,098
  • 6
  • 27
  • 33
0

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...

Eli_B
  • 163
  • 2
  • 10