How to check the existence of the specified file in MatLab? - exist -- MatLab
How to check the existence of the specified file in MatLab? - exist -- MatLab
How to check the existence of the specified file in MatLab?
[Ans]
exist
[syntax]
<result>=exist(<name>);
<result>=exist(<name>,<searchType>);
[description]
<result>=exist(<name>);
0 —
namedoes not exist or cannot be found for other reasons. For example, ifnameexists in a restricted folder to which MATLAB® does not have access,existreturns 0.1 —
nameis a variable in the workspace.2 —
nameis a file with extension.m,.mlx, or.mlapp, ornameis the name of a file with a non-registered file extension (.mat,.fig,.txt).3 —
nameis a MEX-file on your MATLAB search path.4 —
nameis a loaded Simulink® model or a Simulink model or library file on your MATLAB search path.5 —
nameis a built-in MATLAB function. This does not include classes.6 —
nameis a P-code file on your MATLAB search path.7 —
nameis a folder.8 —
nameis a class. (existreturns 0 for Java classes if you start MATLAB with the-nojvmoption.)
<result>=exist(<name>,<searchType>);
It will return true when <name> is kind of <searchType>.
Otherwise, return false.
more details on:
Comments
Post a Comment