| Contents | Index |
The tempdir and tempname functions assist in locating temporary data on your system.
Function | Purpose |
|---|---|
Get temporary folder name. | |
Get temporary filename. |
Use these functions to create temporary files. Some systems delete temporary files every time you reboot the system. On other systems, designating a file as temporary can mean only that the file is not backed up.
The tempdir function returns the name of the folder that has been designated to hold temporary files on your system. For example, issuing tempdir on The Open Group UNIX systems returns the /tmp folder.
MATLAB also provides a tempname function that returns a filename in the temporary folder. The returned filename is a suitable destination for temporary data. For example, if you need to store some data in a temporary file, then you might issue the following command first:
fid = fopen(tempname, 'w');
Note The filename that tempname generates is not guaranteed to be unique; however, it is likely to be so. |
![]() | Exporting Binary Data with Low-Level I/O | Memory-Mapping Data Files | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |