I've run into a couple of bugs that maybe related. I'm running this on MATLAB 2013b, Win64 7.
1. When I run ShadowProj2, the first time around it appears to operate as expected. However, on the second call in the same Matlab session, the bit mask is all zeros even for the same exact call.
2. After the initial call, if I clear the workspace and make a subsequent call to ShadowProj2 MATLAB throws a system error.
Nice implementation and it's nice that it has the same output as "dir". My only grep is that it can be somewhat slow when you're recursing through really dense file structures. This could be my file system or the fact the implementation is pure MATLAB, which is nicely portable, but it would be nice to parse sections out to an option mex file for extra speed.