I am using exist(x, \'file\') to check for the existence of a file on my machine. The execution of this command takes FOREVER (over 10 seconds per call!).
My matl
Here's one idea. You could put the directory containing those header files up at the front of the MATLAB path, so when exist()
goes looking through the path, it finds them quickly and doesn't have to search through the rest of the entries. If it's spending its time stepping through your path, that may help.