MATLAB: Problem opening fig files by double clicking

dragan

I have the latest version of Matlab (2011a) and I find that when I double-click on the .fig file it opens an instance of Matlab but the file itself does not open. I then either have to drag the file into the command window or browse to it in order to open it. What's happening here? Double-clicking on the file should be enough to open it. Thanks.

Best Answer

Double-clicking on a .fig file only does an openfig(), which would at most restore the figure to the saved state. The saved state might have the figure set to invisible, or only partly constructed, or sized incorrectly, or positioned off of your screen, or so on.
It has always been the case that in order to open a saved figure properly, you need to run the .m file that has the same name as the figure, as that .m file needs to call initialization routines that build the figure completely.