if (exist("itemcount") == 1) % here it checks if itemcount is a variable, by changing the value after ==, you can check for function name, file name, dir, path etc. end
Note: the item element is in double quotation marks.
By changing the value after ==, you can check the function name, file name, dir, path, etc.
from / more information at: https://www.gnu.org/software/octave/doc/interpreter/Status-of-Variables.html#XREFexist
other return values. 2, if the name is an absolute file name, a regular file in the Octaves path, or (after adding ".m) a function file in the Octaves path, 3 if it is a .oct name or .mex file in the Octaves path, 5 if the name is a built-in function , 7 if the name is a directory, or 103 if the name is a function not associated with the file (entered on the command line), otherwise return 0.
skdev75
source share