You can check if a "filename.mat" file exists in Matlab using the exist
function. The code to perform this would look like this:
main.m102 chars6 lines
The exist
function returns 2 if the file exists, 0 if it does not, and 7 if it exists on the Matlab search path, but is not found in the current directory. The second argument, 'file'
, is passed to tell exist
to search for a file with that name specifically.
gistlibby LogSnag