Percorso di ricerca
Il percorso di ricerca di MATLAB è un sottoinsieme di tutte le cartelle del file system. MATLAB utilizza il percorso di ricerca per individuare in modo efficiente i file utilizzati con i prodotti MathWorks®. Per maggiori informazioni, vedere What Is the MATLAB Search Path?
Funzioni
addpath | Aggiungere cartelle al percorso di ricerca |
rmpath | Remove folders from search path |
path | View or change search path |
savepath | Save current search path |
userpath | View or change default user work folder |
genpath | Generate search path |
pathsep | Search path separator for current platform |
pathtool | Open Set Path dialog box to view and change search path |
restoredefaultpath | Restore search path to factory-installed state |
rehash | Refresh function and file system path caches |
Argomenti
- What Is the MATLAB Search Path?
The search path, or path is a subset of all the folders in the file system that MATLAB uses to locate files efficiently.
- Change Folders on Search Path
Interactively add and remove folders, and change the order of folders on the search path, for the current MATLAB session and for future MATLAB sessions.
- Use Search Path with Different MATLAB Installations
The default search path changes for each MATLAB version because the default folders that come with the products change.
- Add Folders to the MATLAB Search Path at Startup
The
startup.mfile is for specifying startup options. Add folders to the search path by includingaddpathstatements instartup.m. - Assign userpath as Startup Folder (Macintosh or UNIX)
Assign the
userpathfolder as the startup folder on Macintosh or UNIX® platforms. - File e cartelle a cui accede MATLAB
Quando non si specifica un percorso per un file, MATLAB cerca il file nella cartella corrente o nel percorso di ricerca. Le funzioni nella cartella corrente hanno la precedenza sulle funzioni con lo stesso nome del file che si trovano in qualsiasi posizione del percorso di ricerca.
- Toolbox Path Caching in MATLAB
For performance reasons, MATLAB caches
matlabrootfolder information across sessions.
Risoluzione dei problemi
Resolve Issue: MATLAB Did Not Appear to Successfully Set the Search Path
Troubleshoot: MATLAB Did Not Appear to Successfully Set the Search Path. If there is a problem with the search path, you cannot use MATLAB successfully.
Errors When Updating Folders on Search Path
You can encounter errors or unexpected behavior when you try to delete, rename, or move folders.
Troubleshoot Invalid or Unresponsive Windows Change Notification Handles
If MATLAB is unable to detect changes to your files and folder due to invalid or unresponsive change notification handles, you can change how MATLAB detects changes in folders.