Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

toolboxdir

Root folder for specified toolbox

Syntax

s = toolboxdir(toolboxName)

Description

example

s = toolboxdir(toolboxName) returns a character vector containing the absolute path to the root folder for the specified toolbox.

It is important to use the toolboxdir function when writing code using MATLAB® Compiler™. A toolbox can have a different path depending on whether it is running from MATLAB or from an application deployed with the MATLAB Compiler. toolboxdir ensures that the correct path is used.

Examples

collapse all

Suppose that you have MATLAB R2017b installed with the Control System Toolbox™. Get the path for the Control System Toolbox.

s = toolboxdir('control')
s  = C:\Program Files\MATLAB\R2017b\toolbox\control

Input Arguments

collapse all

Toolbox name, specified as a character vector.

Tips

  • To determine the toolbox name to use for a given toolbox, run this code, substituting toolbxfcn with the name of a function in the product.

    n = 'toolbxfcn';
    pat = '(?<=[\\/]toolbox[\\/])[^\\/]+';
    regexp(which(n), pat, 'match', 'once')
    

    For example, to determine the toolbox name for Control System Toolbox, set n to the name of a function unique to Control System Toolbox, such as dss.

    n = 'dss'
    pat = '(?<=[\\/]toolbox[\\/])[^\\/]+'
    regexp(which(n), pat, 'match', 'once')
    
    control

Introduced in R2006a

Was this topic helpful?