Why are toolbox paths not added to the MATLAB path automatically if new toolboxes are added to an existing MATLAB version?

124 views (last 30 days)
After I installed a new toolbox and tried to use a function from that toolbox, I received the following error:
???Undefined function or variable 'function or variable name'

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This bug has been fixed for Release 14 (R14). For previous releases, read below for any possible workarounds:
If you just installed a new toolbox, this error will occur because the toolbox was not automatically added to the MATLAB path. Each toolbox installed should have a folder associated with it off the main $MATLAB\toolbox directory. Some toolboxes have multiple folders inside their main $MATLAB\toolbox\tlbx_name directory.
NOTE: If you do not have directories for your installed toolboxes, then they were not installed properly. Make sure you use your root MATLAB directory as the destination directory when you install additional Toolboxes.
Once you are sure the toolbox got installed, to fix this you will need to manually add these directories to the MATLAB path. You can do this by using the path browser, which can be accessed through the toolbar, or by typing "pathtool" at the MATLAB Command Prompt. This will call up an easy-to-use GUI that will help you add the proper directories to the MATLAB path. Make sure to save the changes so they will be used in future instances of MATLAB.
If this fails, search your machine for an extra copy of pathdef.m (check for any instances of this file that are not in $MATLAB\toolbox\local) and delete any extra copies.
If this fails, there may be a conflict with your MATLAB installation and something on your system such as a driver or hardware device. This could be avoided by booting your computer in safe mode. For instructions on how to boot your Windows computer into safe mode, see the Related Solution.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!