Programming > Files and Folders
38 functions in MATLAB › Programming > Files and Folders.
Search Path
addpath | Adds folders to the top of the search path. |
genpath | Returns a path string listing a folder and all of its subfolders. |
path | Shows or sets the search path. |
pathsep | Returns the character that separates folders in a path string. |
rehash | Refreshes the program's cache of the folders on the path. |
restoredefaultpath | Resets the search path to its default folders. |
rmpath | Removes folders from the search path. |
userpath | Returns or sets the user's default working folder. |
File Operations
cd | Shows or changes the current folder. |
copyfile | Copies a file or a folder. |
dir | Lists the files and folders that match a name or pattern. |
exist | Checks whether a variable, file, folder or function exists, and what kind it is. |
fileattrib | Reads the attributes of a file or folder. |
isdir | Tests whether a name is a folder (superseded by isfolder). |
isfile | Tests whether a name is an existing file. |
isfolder | Tests whether a name is an existing folder. |
ls | Lists the names of the files and folders in a folder. |
mkdir | Creates a folder, including any missing parent folders. |
movefile | Moves or renames a file or folder. |
pwd | Returns the current folder. |
recycle | Gets or sets whether deleted files go to the recycle bin. |
rmdir | Removes a folder. |
what | Lists the MATLAB files in a folder, grouped by type. |
which | Locates a function, script, file or variable. |
File Name Construction
filemarker | Returns the character that separates a file name from a local function name. |
fileparts | Splits a file path into folder, name and extension. |
filesep | Returns the file separator of the platform. |
fullfile | Builds a file path from folder and file name parts. |
matlabroot | Returns the folder where the program is installed. |
tempdir | Returns the folder for temporary files. |
tempname | Returns a unique name for a temporary file. |
toolboxdir | Returns the folder of a toolbox. |
File Compression
gunzip | Decompresses files compressed with gzip. |
gzip | Compresses files individually into gzip files. |
tar | Packs files and folders into a tar archive. |
untar | Extracts the files of a tar archive. |
unzip | Extracts the files of a zip archive. |
zip | Compresses files and folders into a zip archive. |