tempdir

Returns the folder for temporary files.

Category: Programming > Files and Folders

Syntax

d = tempdir

Returns the path of the system's temporary folder.

Description

The value depends on the machine and on the user, so it is meant for building paths, as in fullfile(tempdir, 'scratch.dat'), and not for printing. Files left in the temporary folder are not removed automatically by the program; delete the ones you create.

Output arguments

d
Folder path, ending with a file separator.

Example

The temporary folder

d = tempdir;
isfolder(d)
d(end) == filesep
Output
ans = logical
   1
ans = logical
   1

See also

tempname fullfile delete mkdir