I recommend not creating a variable named path, as path already has a meaning in MATLAB. See doc path for more information on that function.
Just because you define a variable named path does not mean that functions like dir will automatically look there. I recommend you use fullfile to assemble the path to the folder and the extension you want to search for.
location = fullfile(matlabroot, 'toolbox', 'matlab', 'general')
D = dir(fullfile(location, filespec))
If I'd just asked for the file using the filespec it wouldn't have looked in that directory and so wouldn't have found any such files.