please help to decode the error using data mining

3 views (last 30 days)
Undefined function or variable 'figure1_CreateFcn'.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in Project_123210082_123210177 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)Project_123210082_123210177('figure1_CreateFcn',hObject,eventdata,guidata(hObject))
Undefined function or variable 'edit5_CreateFcn'.
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in Project_123210082_123210177 (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)Project_123210082_123210177('edit5_CreateFcn',hObject,eventdata,guidata(hObject))
function varargout = Project_123210082_123210177(varargin)
% PROJECT_123210082_123210177 MATLAB code for Project_123210082_123210177.fig
% PROJECT_123210082_123210177, by itself, creates a new PROJECT_123210082_123210177 or raises the existing
% singleton*.
%
% H = PROJECT_123210082_123210177 returns the handle to a new PROJECT_123210082_123210177 or the handle to
% the existing singleton*.
%
% PROJECT_123210082_123210177('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PROJECT_123210082_123210177.M with the given input arguments.
%
% PROJECT_123210082_123210177('Property','Value',...) creates a new PROJECT_123210082_123210177 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Project_123210082_123210177_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Project_123210082_123210177_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 Project_123210082_123210177
% Last Modified by GUIDE v2.5 28-May-2023 20:02:57
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Project_123210082_123210177_OpeningFcn, ...
'gui_OutputFcn', @Project_123210082_123210177_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 Project_123210082_123210177 is made visible.
function Project_123210082_123210177_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 Project_123210082_123210177 (see VARARGIN)
% Choose default command line output for Project_123210082_123210177
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes Project_123210082_123210177 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = Project_123210082_123210177_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 showdata.
function showdata_Callback(hObject, eventdata, handles)
% hObject handle to showdata (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
dataset = readtable("raisin.xlsx");
data = table2cell(dataset);
columnName = ["Area" "MajorAxisLength" "MinorAxisLength" "Eccentricity" "ConvexArea" "Extent" "Perimeter " "Class"];
set(handles.uitable1, 'ColumnName', columnName);
set(handles.uitable1,'data',data);
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (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 edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (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 classify.
function classify_Callback(hObject, eventdata, handles)
% hObject handle to classify (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
area = str2double(get(handles.area,'String'));
major_axis = str2double(get(handles.major_axis,'String'));
minor_axis = str2double(get(handles.minor_axis,'String'));
eccent = str2double(get(handles.eccent,'String'));
convex_area = str2double(get(handles.convex_area,'String'));
extent = str2double(get(handles.extent,'String'));
perimeter = str2double(get(handles.perimeter,'String'));
sample = [area major_axis minor_axis eccent convex_area extent perimeter];
opts = detectImportOptions("raisin.xlsx");
opts.SelectedVariableNames = (1:7);
training = readmatrix("raisin.xlsx", opts);
opts = detectImportOptions("raisin.xlsx");
opts.SelectedVariableNames = (7);
group = readmatrix("raisin.xlsx", opts);
class = fitcknn(training, group, 'NumNeighbors', 4);
klasifikasi = predict(class, sample);
set(handles.edit1, 'String', klasifikasi);
function area_Callback(hObject, eventdata, handles)
% hObject handle to area (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 area as text
% str2double(get(hObject,'String')) returns contents of area as a double
% --- Executes during object creation, after setting all properties.
function area_CreateFcn(hObject, eventdata, handles)
% hObject handle to area (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 edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
function major_axis_Callback(hObject, eventdata, handles)
% hObject handle to major_axis (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 major_axis as text
% str2double(get(hObject,'String')) returns contents of major_axis as a double
% --- Executes during object creation, after setting all properties.
function major_axis_CreateFcn(hObject, eventdata, handles)
% hObject handle to major_axis (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 minor_axis_Callback(hObject, eventdata, handles)
% hObject handle to minor_axis (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 minor_axis as text
% str2double(get(hObject,'String')) returns contents of minor_axis as a double
% --- Executes during object creation, after setting all properties.
function minor_axis_CreateFcn(hObject, eventdata, handles)
% hObject handle to minor_axis (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 eccent_Callback(hObject, eventdata, handles)
% hObject handle to eccent (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 eccent as text
% str2double(get(hObject,'String')) returns contents of eccent as a double
% --- Executes during object creation, after setting all properties.
function eccent_CreateFcn(hObject, eventdata, handles)
% hObject handle to eccent (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 convex_area_Callback(hObject, eventdata, handles)
% hObject handle to convex_area (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 convex_area as text
% str2double(get(hObject,'String')) returns contents of convex_area as a double
% --- Executes during object creation, after setting all properties.
function convex_area_CreateFcn(hObject, eventdata, handles)
% hObject handle to convex_area (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 extent_Callback(hObject, eventdata, handles)
% hObject handle to extent (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 extent as text
% str2double(get(hObject,'String')) returns contents of extent as a double
% --- Executes during object creation, after setting all properties.
function extent_CreateFcn(hObject, eventdata, handles)
% hObject handle to extent (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 perimeter_Callback(hObject, eventdata, handles)
% hObject handle to perimeter (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 perimeter as text
% str2double(get(hObject,'String')) returns contents of perimeter as a double
% --- Executes during object creation, after setting all properties.
function perimeter_CreateFcn(hObject, eventdata, handles)
% hObject handle to perimeter (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

Answers (1)

Image Analyst
Image Analyst on 28 May 2023
Add this to the end of your .m file:
%=============================================================================================
% --- Executes during object creation, after setting all properties.
function edit5_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
  6 Comments
Image Analyst
Image Analyst on 29 May 2023
If this Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.

Sign in to comment.

Categories

Find more on Graphics Object Programming 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!