You didn't get the folder of your file. And with compiled apps, they don't live where you think they do - in the folder where your executable lives, they actually live in some temporary folder. Issue the command
fprintf('Current folder = %s\n', ctfroot);
to see where this really is. You did not install your folder there obviously because there was no way for you to know where that was until you ran the program and got the ctfroot string value.
It's almost never a good practice to assume files will be in the current directory, and it's even more so when you have compiled programs. You NEED to make sure you know at all times the folder where your files live. Your edit field apparently does not contain the full path and has just the basefilename. Then you don't prepend a path, the KNOWN path, where you expect the file to be. Hence your error - you're not looking in the right place when you call load(). Make sure you use fullfile() and exist(, 'file'), and try and catch, and find out what ctfroot is. Also call Mathworks and ask them to explain to you what the environment variable MCR_CACHE_ROOT is. Compiling is very tricky and I don't have time now for a full tutorial. Finally, make sure you check out the FAQ:
Best Answer