error 'Undefined variable "matlab" or class "matlab.in​ternal.edi​tor.EOData​Store.getR​ootField". '

7 views (last 30 days)
I have a guide-created GUI named opLocInfo. When I try to open it in R2017a, I get this error:
Undefined variable "matlab" or class "matlab.internal.editor.EODataStore.getRootField".
Error in matlab.hg.internal.openfigLegacy (line 73)
editorId = matlab.internal.editor.EODataStore.getRootField('ROOT');
Error in gui_mainfcn>local_openfig (line 286)
gui_hFigure = matlab.hg.internal.openfigLegacy(name, singleton, visible);
Error in gui_mainfcn (line 158)
gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
Error in opLocInfo (line 42)
gui_mainfcn(gui_State, varargin{:});
Any suggestions? opLocInfo.m, as created in guide, is here:
function varargout = opLocInfo(varargin)
% OPLOCINFO M-file for opLocInfo.fig
% OPLOCINFO, by itself, creates a new OPLOCINFO or raises the existing
% singleton*.
%
% H = OPLOCINFO returns the handle to a new OPLOCINFO or the handle to
% the existing singleton*.
%
% OPLOCINFO('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in OPLOCINFO.M with the given input arguments.
%
% OPLOCINFO('Property','Value',...) creates a new OPLOCINFO or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before opLocInfo_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to opLocInfo_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help opLocInfo
% Last Modified by GUIDE v2.5 03-Jan-2017 12:20:25
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @opLocInfo_OpeningFcn, ...
'gui_OutputFcn', @opLocInfo_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before opLocInfo is made visible.
function opLocInfo_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to opLocInfo (see VARARGIN)
% Choose default command line output for opLocInfo
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes opLocInfo wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = opLocInfo_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function sosEdit_Callback(hObject, eventdata, handles)
% hObject handle to sosEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of sosEdit as text
% str2double(get(hObject,'String')) returns contents of sosEdit as a double
% --- Executes during object creation, after setting all properties.
function sosEdit_CreateFcn(hObject, eventdata, handles)
% hObject handle to sosEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes during object creation, after setting all properties.
function mapSizeEdit_CreateFcn(hObject, eventdata, handles)
% hObject handle to mapSizeEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in showXCorrCheckbox.
function showXCorrCheckbox_Callback(hObject, eventdata, handles)
% hObject handle to showXCorrCheckbox (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hint: get(hObject,'Value') returns toggle state of showXCorrCheckbox
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
opLocate('loadStatic')
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in loadDynamicButton.
function loadDynamicButton_Callback(hObject, eventdata, handles)
% hObject handle to loadDynamicButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
opLocate('loadDynamic')
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in loadDynamicButton.
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to loadDynamicButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in loadStaticButton.
function loadStaticButton_Callback(hObject, eventdata, handles)
% hObject handle to loadStaticButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
opLocate('loadStatic')
function originEdit_Callback(hObject, eventdata, handles)
% hObject handle to originEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of originEdit as text
% str2double(get(hObject,'String')) returns contents of originEdit as a double
opLocate('originChanged')
% --- Executes during object creation, after setting all properties.
function originEdit_CreateFcn(hObject, eventdata, handles)
% hObject handle to originEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function spotIdEdit_Callback(hObject, eventdata, handles)
% hObject handle to spotIdEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of spotIdEdit as text
% str2double(get(hObject,'String')) returns contents of spotIdEdit as a double
opLocate('spotIdsChanged')
% --- Executes during object creation, after setting all properties.
function spotIdEdit_CreateFcn(hObject, eventdata, handles)
% hObject handle to spotIdEdit (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
  6 Comments
David Mellinger
David Mellinger on 15 Aug 2017
Not surprised about opLocate being missing; opLocInfo is part of a larger package that includes a lot of files, including opLocate.
I run the code by either typing in "opLocInfo" to the command prompt or from another routine, opLocate.m, that does acoustic localization. That routine calls opLocInfo with no arguments.
Since it works for you, there must be something in my configuration that's not right. 'ver' shows this:
MATLAB Version: 9.2.0.556344 (R2017a)
MATLAB License Number: 183019
Operating System: Microsoft Windows 7 Professional Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
MATLAB Version 9.2 (R2017a)
Neural Network Toolbox Version 10.0 (R2017a)
Optimization Toolbox Version 7.6 (R2017a)
Signal Processing Toolbox Version 7.4 (R2017a)
Wavelet Toolbox Version 4.18 (R2017a)
Also, when I start up MATLAB, I get these error messages:
Warning: Name is nonexistent or not a directory: C:\Program
Files\MATLAB\R2017a\toolbox\matlab\external\engines\python
Warning: Name is nonexistent or not a directory: C:\Program
Files\MATLAB\R2017a\toolbox\matlab\hds
Is any of that any help?
Another question: Are you getting the same call sequence as I am? That is, if you put a breakpoint at line 73 of matlab.hg.internal.openfigLegacy (the line where my code bombs), does execution reach that point for you, with the stack as shown in my first posting above?
Thanks for your help!

Sign in to comment.

Answers (2)

David Mellinger
David Mellinger on 16 Aug 2017
I found a comment that suggested these problems might be due to having two versions of MATLAB installed. So I uninstalled both extant versions (R2015a and R2017a) and reinstalled from scratch.
And voilà! The problem went away. So it "merely" versionitis.

quai20
quai20 on 9 Jul 2018
Same error for me. In my case it was the path definition (pathdef.m when opening matlab) that induced this error. Removing it and changing my path after matlab was opened solved the issue.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!