MATLAB: The GUI (made with guide) opens with a specific image on the computer, and gives error while loading another one

guiMATLAB Compiler

This is the error I get, when I try to load new image (the image is loaded my moving cursor on GUI gives this error):
*Error while evaluating Figure WindowButtonMotionFcn
Error using matlab.graphics.primitive.Image/get Invalid or deleted object.
Error in impixelinfoval/displayPixelInfo (line 126) elseif strcmp(get(him,'tag'),'rset overview')
Error in iptaddcallback/callbackProcessor (line 147) fun(varargin{:});
Error while evaluating Figure WindowButtonMotionFcn*
Previously it was working fine. Now when I load the GUI by running .m file, it opens in one folder above and not in the same folder :(. Please help!!! I am using MATLAB 2016a

Best Answer

Most likely you're not specifying the full filename properly.
Also, let's see what you do between calling uigetdir() and imread() or whatever.