Error using ui_mex_link
configuration error
Error in gray_mex
Error in extract_layers (line 61)
gray_mex
Error in Layer_Extraction_App>pushbutton4_Callback (line 133)
extract_layers(img,handles);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in Layer_Extraction_App (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)Layer_Extraction_App('pushbutton4_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.
The code1 of matlab
function varargout = Layer_Extraction_App(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Layer_Extraction_App_OpeningFcn, ...
'gui_OutputFcn', @Layer_Extraction_App_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 Layer_Extraction_App is made visible.
function Layer_Extraction_App_OpeningFcn(hObject, eventdata, handles, varargin)
handles.sel=1;
set(handles.text4, 'String', ' ');
set(handles.text5, 'String', ' ');
set(handles.text6, 'String', ' ');
set(handles.text7, 'String', ' ');
set(handles.text8, 'String', ' ');
set(handles.text9, 'String', ' ');
% Choose default command line output for Layer_Extraction_App
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Layer_Extraction_App wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Layer_Extraction_App_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)
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
function pushbutton3_Callback(hObject, eventdata, handles)
% --- 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)
[f,p]=uigetfile('layer_img/*.*', 'Specify an image file');
img=imread([p,f]);
yrange = [];
xrange = [];
% make image type as double.
% img =imread('DME-1081406-1.jpeg');
img = double(img);
% figure,
axes(handles.axes1);
imshow(img)
% get size of image.
szImg = size(img);
if isempty(yrange) && isempty(xrange)
yrange = 1:szImg(1);
xrange = 1:szImg(2);
end
img = img(yrange,xrange);
extract_layers(img,handles);
% --- 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)
close Layer_Extraction_App
Main_App
% --- Executes on button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close Layer_Extraction_App
Classifier_App
% --- Executes on button press in radiobutton1.
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject handle to radiobutton1 (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 radiobutton1
handles.sel=get(hObject,'Value');
if(handles.sel==1)
set(handles.text3, 'String', 'marking');
else
set(handles.text3, 'String', 'contionus ');
end
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
Code 2: suporting file where code1 is used
function varargout = Main_App(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Main_App_OpeningFcn, ...
'gui_OutputFcn', @Main_App_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 Main_App is made visible.
function Main_App_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 Main_App (see VARARGIN)
% ah=axes('unit','normalized','position',[0 0 1 1]);
% bg=imread('App_Cover.png'); imagesc(bg);
% set(ah,'handlevisibility','off','visible','off');
% uistack(ah,'bottom');
% Choose default command line output for Main_App
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Main_App wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Main_App_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)
close Main_App
Classifier_App
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close Main_App
Layer_Extraction_App