Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

searchenv

Searches for a file using environment paths.

Syntax

  • c = searchenv(filename, env_name)

Input argument

  • env_name - a string: environment variable name.
  • filename - a string: filename searched in environment variable.

Output argument

  • c - a cell of strings: full paths found in environment variable.

Description

searchenv Searches for a file using environment paths.

Example

[modules, paths] = getmodules();
env_value = '';
for p = paths
 env_value = [env_value, pathsep, p];
end

setenv('MY_PATH_ENV', env_value);
c = searchenv('loader.m', 'MY_PATH_ENV')

See also

getenv, setenv.

History

VersionDescription
1.0.0initial version

Author

Allan CORNET