Folder into which AttachedFiles are written
folder = getAttachedFilesFolder
folder = getAttachedFilesFolder returns a string, which is the path to the local folder into which AttachedFiles are written. This function returns an empty array if it is not called on a MATLAB® worker.
Find the current AttachedFiles folder.
folder = getAttachedFilesFolder;
Change to that folder to invoke an executable that was included in AttachedFiles.
oldFolder = cd(folder);
Invoke the executable.
[OK, output] = system('myexecutable');
Change back to the original folder.