Search path for the command ‘ Read ’
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
READPATH determines the directories, where
Possible values: String or a sequence of strings.
READPATH can represent more
than one search directory. This variable can be assigned a sequence
of strings: each element of the sequence represents a directory in
which files are search for.
When concatenated with a file name, the directories given by the path variables must produce valid path names.
Path names are slightly system dependent. You can separate subdirectories
/ on all systems. On Windows® systems,
you may alternatively use a backslash character (
Note that in MuPAD®, a single backslash inside a character
string is created by typing two backslashes. E.g., the MuPAD string
representing the path “
must be defined by
to create path names independent of the current operating system.
This example shows how to define a
More than one path may be given.
read will look for files to be opened
in the directories given by
READPATH. The following
produces a valid
READPATH for UNIX® and Linux® systems
only, since the path separators are hard coded in the strings:
READPATH := "math/lib/", "math/local/"
It is good programming style to use platform independent path
strings. This can be achieved with the function
READPATH := pathname("math", "lib"), pathname("math", "local")
All path variables can be set to their default values by deleting them:
The path variable
WRITEPATH only accepts
one path string:
WRITEPATH := "math/lib/", "math/local/"
Error: Invalid argument. [WRITEPATH]