exist
exist variable返回 %variable% 对应整数, 若为 0 则无重名exist('variable)同上
对应整数表
| Integer | Meaning |
|---|---|
| 0 | name does not exist or cannot be found |
| 1 | name is a variable in the Workspace |
| 2 | name is a file with extension .m, .mlx, or .mlapp, or is file.ext which exists in the folder |
| 3 | name is a MEX-file on your MATLAB search path |
| 4 | name is a Simulink model or library file on your MATLAB search path |
| 5 | name is a built-in function |
| 6 | name is a P-code file on your MATLAB search path |
| 7 | name is a folder |
| 8 | name is a class |