Matlab 2014b: figure() dbstops

조회 수: 6 (최근 30일)
Luke Robison
Luke Robison 2014년 10월 14일
댓글: Patrick Vacek 2015년 5월 11일
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'.

채택된 답변

Luke Robison
Luke Robison 2014년 10월 15일
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.
  댓글 수: 1
Patrick Vacek
Patrick Vacek 2015년 5월 11일
Just in case someone else comes along here in the future... check for a startup.m in your path and see if there is anything running that you weren't aware of. In my case there was an errant callback that didn't work with the new Matlab 2014b graphics system.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Sean de Wolski
Sean de Wolski 2014년 10월 14일
Have you tried:
dbstop if error
To see the error where it is happening to figure out what is being called and how?
  댓글 수: 2
Luke Robison
Luke Robison 2014년 10월 14일
The error happens in int2str. int2str is called by Matlab's builtin 'figure'. Figure is called from me sitting at the prompt.
I can produce the problem simply by running 'figure()' in a brand new session.
Sean de Wolski
Sean de Wolski 2014년 10월 14일
In that case contact MathWorks' Technical Support.

댓글을 달려면 로그인하십시오.


Mike Garrity
Mike Garrity 2014년 10월 14일
It sounds like you have some code which depends on the fact that handles to graphics objects were implemented as doubles in earlier versions.
In R2014b they're now objects. Check out this section of the doc for some details about this change and how to deal with it.
  댓글 수: 1
Luke Robison
Luke Robison 2014년 10월 14일
But this is Matlab's int2str complaining about Matlab's usage when I call Matlab's 'figure()' routine. All of my code is out of the picture.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by