Hello my code gui can run passed but the error when this appear in my command window when i run my GUI.
that my code
function varargout = bebear(varargin)gui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @bebear_OpeningFcn, ... 'gui_OutputFcn', @bebear_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); %'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 endfunction bebear_OpeningFcn(hObject, eventdata, handles, varargin) get(eventdata) handles.output = hObject; guidata(hObject, handles); endfunction varargout = bebear_OutputFcn(hObject, eventdata, handles) get(hObject)get(eventdata) varargout{1} = handles.output; endfunction browse_human_Callback(hObject, eventdata, handles)get(hObject)get(eventdata)[filename pathname] = uigetfile({'*.jpg';'*.png'},'File Selector');image = strcat(pathname, filename);axes(handles.axes1)imshow(image)h = imline;setColor(h,[1 0 0]);%position = wait(h);
global posHposH = getPosition(h)endfunction browse_bear_Callback(hObject, eventdata, handles)get(hObject)get(eventdata)[filename pathname] = uigetfile({'*.jpg';'*.png'},'File Selector');image = strcat(pathname, filename);axes(handles.axes2)imshow(image)b = imline;setColor(b,[1 0 0]);%position = wait(h);global posBposB = getPosition(b)endfunction cal_CreateFcn(hObject, eventdata, handles)endfunction calculate_Callback(hObject, eventdata, handles)tallH = str2double(get(handles.height_hu,'String'));get(hObject)get(eventdata)global posHglobal posBsumH = posH;sumhY1 = posH(1,2);sumhY2 = posH(2,2);lineH = sumhY2 - sumhY1 sumB = posB;sumbY1 = posB(1,2);sumbY2 = posB(2,2);lineB = sumbY2 - sumbY1 tallB = (tallH/lineH)* lineBset(handles.height_bear, 'String', tallB)endfunction pic_CreateFcn(hObject, eventdata, handles)get(hObject);get(eventdata);get(handles);image = imread('bear.png');imshow(image)end
error massage:
??? Error using ==> fevalUndefined function or method 'height_bear_CreateFcn' for input arguments of type 'double'.Error in ==> gui_mainfcn at 96 feval(varargin{:});Error in ==> bebear at 18 gui_mainfcn(gui_State, varargin{:});Error in ==>@(hObject,eventdata)bebear('height_bear_CreateFcn',hObject,eventdata,guidata(hObject))?? Error using ==> struct2handleError while evaluating uicontrol CreateFcn
how can I fix it
Best Answer