when using matlab, we can use the command
exist uname
to see if the uname exists, uname can be a file, directory, varibale, class ....
now if i have a variable dir
dir is a string, the value is dir = '/scratch/lailai/'
exist dir
gives value 1, since dir is a variable.
how to use such command to first explain the value of dir, then exist the direcotory,
we use
eval(sprintf('exist %s'),dir)
exist uname
to see if the uname exists, uname can be a file, directory, varibale, class ....
now if i have a variable dir
dir is a string, the value is dir = '/scratch/lailai/'
exist dir
gives value 1, since dir is a variable.
how to use such command to first explain the value of dir, then exist the direcotory,
we use
eval(sprintf('exist %s'),dir)