필터 지우기
필터 지우기

Error while evaluating UIControl Callback

조회 수: 1 (최근 30일)
Anisio Gomes
Anisio Gomes 2015년 12월 28일
답변: Walter Roberson 2015년 12월 29일
Hi guys!
here is a bit of my code from my matlab project, the function b and c are okay, but the resolve function seems, to be with a problem, it displays
Not enough input arguments.
Error in lay_out>resolve (line 129) X11 = handles.mydata.b * handles.mydata.c;
function b1(hObject, eventdata, handles)
b = str2double(get(hObject, 'String'));
if isnan(b)
set(hObject, 'String', 0);
warndlg('Only numbers are supported', '!! Warning!!');
end
% Save the new b value
handles.mydata.b = b;
guidata(hObject,handles)
end
function c1(hObject, eventdata, handles)
c = str2double(get(hObject, 'String'));
if isnan(c)
set(hObject, 'String', 0);
warndlg('Only numbers are supported', '!! Warning!!');
end
% Save the new c value
handles.mydata.c = c;
guidata(hObject,handles)
end
function resolve(hObject,eventdata,handles)
X11 = handles.mydata.b * handles.mydata.c;
set(handles.x11, 'String', 1);
end
  댓글 수: 2
Walter Roberson
Walter Roberson 2015년 12월 28일
We need to see the routine in which a reference is made to resolve()
Walter Roberson
Walter Roberson 2015년 12월 29일
[Merged from duplicate question]
function a1(hObject, eventdata, handles)
a = str2double(get(hObject, 'String'));
if isnan(a)
set(hObject, 'String', 1);
warndlg('Only numbers are supported', '!! Warning!!');
elseif(a==0)
set(hObject, 'String', 1);
[cdata,map]=imread('zero.jpg');
z=msgbox('a cannoct be zero for a quadratic equation','Try again', 'custom', cdata,map);
end
% Save the new a value
handles.mydata.a = a;
guidata(hObject,handles)
end
function b1(hObject, eventdata, handles)
b = str2double(get(hObject, 'String'));
if isnan(b)
set(hObject, 'String', 0);
warndlg('Only numbers are supported', '!! Warning!!');
end
% Save the new b value
handles.mydata.b = b;
guidata(hObject,handles)
end
function c1(hObject, eventdata, handles)
c = str2double(get(hObject, 'String'));
if isnan(c)
set(hObject, 'String', 0);
warndlg('Only numbers are supported', '!! Warning!!');
end
% Save the new c value
handles.mydata.c = c;
guidata(hObject,handles)
end
function resolve(hObject,eventdata,handles)
X11 = handles.mydata.b * handles.mydata.c;
set(handles.x11, 'String', x11);
end

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

답변 (1개)

Walter Roberson
Walter Roberson 2015년 12월 29일
Your posted code has no reference to resolve(), only the definition of the routine. How are you invoking resolve?

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by