exist
Check for the existence.
📝Syntax
res = exist(name)
 res = exist(name, category)
📥Input Arguments
Parameter Description
name a string: name of variable, function, file or directory.
category a string: 'var', 'builtin', 'file', or 'dir'.
📤Output Arguments
Parameter Description
res a integer value.
📄Description

exists checks for the existence of variable, builtin, file or directory.

exists returns:

0 does not exist

1 is an variable

2 is a file

3 is a mex function

5 is a builtin or function

7 is a directory

💡Examples
exist('fileread')
fileread = 3;
exist('fileread')
clear fileread
exist('fileread')
🔗See Also
isbuiltinismacroisfileisdirisvar
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub