The function checks if file exists using java.
Ilan Ben Hagai (2021). fileExists (https://www.mathworks.com/matlabcentral/fileexchange/18373-fileexists), MATLAB Central File Exchange. Retrieved .
This function tests whether the file or folder given as input exists. Matlabs exist returns true also for function and class names.
Why are you re-inventing the wheel.
It already exists in Matlab. And yes what a stroke of luck.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!