filesep

File separator for current platform

Syntax

f = filesep

Description

f = filesep returns the platform-specific file separator character. The file separator is the character that separates individual folder and file names in a path string.

Examples

Create a path to the iofun folder on a Microsoft® Windows® platform:

iofun_dir = ['toolbox' filesep 'matlab' filesep 'iofun']

iofun_dir =
   toolbox\matlab\iofun

Create a path to iofun on a UNIX®[1] platform.

iodir = ['toolbox' filesep 'matlab' filesep 'iofun']

iodir =
   toolbox/matlab/iofun

[1] UNIX is a registered trademark of The Open Group in the United States and other countries.

Was this topic helpful?