MATLAB: Matlab 2014b: figure() dbstops

figureint2strmatlab 2014brealsettings

I think my matlab path is very broken. This is on a Fresh install of Windows 7 x64.
We just installed 2014b beside 2012b (which still works). The first time I ran 2014b, the Matlab-provided matlabrc file encountered an error trying to create a Settings handle (try running "Settings"). A little searching online suggested restoredefaultpath, which did indeed allow Settings to return a valid handle. I exited Matlab, started again, and got to a prompt uninterrupted. I made a few figures to look at the new plot options, at which point everything was fine.
The next step was to add our existing code to my path, which I did (from the GUI, and saved) without problem. When I tried to run my code I got a puzzling error (sorry, can't copy-paste, so this is from memory):
in int2str(): Undefined function 'real' for input of type 'matlab.ui.Figure'.
This happens any time figure() is called (including via inputdlg, which is how I first found it).
I have tried restoredefaultpath again and have removed my code from the path, but the error persists. Any ideas?
Edit: this is how I can create the error:
>>> % Brand new session
>>> restoredefaultpath
>>> figure();
Error: Undefined function 'real' for input arguments of type 'matlab.ui.Figure'.

Best Answer

I think I've resolved this issue. Somehow the Matlab2012 paths must have been used in the Matlab2014 program. I suspect this is due to a savepath call that saved to a common, non-versioned location and included the wrong version of matlab in the pathdef.m file. The restoredefaultpath function didn't work initially I think because it attempts to load back in the users' custom paths as well, which is where it was finding the Matlab2012 versions.