
Invocar funciones en una GUI
Publicado por Jose (1 intervención) el 03/03/2015 19:23:07
Tengo el siguiente código de una GUI:
Intento usar funciones para realizar una conversión. Sin embargo me sale un error al final que dice:
Los argumentos que le paso a mis funciones son 'dato' y 's'.
Les agradecería que me dijeran dónde está mi error y cómo solucionarlo.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function uipanel5_SelectionChangeFcn(hObject, eventdata, handles)
if (hObject==handles.ej)
e=1
elseif (hObject==handles.ef)
e=2
elseif (hObject==handles.ec)
e=3
elseif (hObject==handles.ee)
e=4
end
function d_Callback(hObject, eventdata, handles)
% hObject handle to d (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
dato=str2double(get(hObject,'String'))
function uipanel6_SelectionChangeFcn(hObject, eventdata, handles)
if hObject==handles.sj
s=1
elseif hObject==handles.sf
s=2
elseif hObject==handles.sc
s=3
elseif hObject==handles.se
s=4
end
if (e==1)
respuesta=cj(dato,s);
elseif (e==2)
respuesta=cf(dato,s);
elseif (e==3)
respuesta=cc(dato,s);
else
respuesta=ce(dato,s);
end
set(handles.r,'String',respuesta);
Intento usar funciones para realizar una conversión. Sin embargo me sale un error al final que dice:
1
2
3
4
5
6
7
8
9
Undefined function or variable 'e'.
Error in Conversor>con_Callback (line 141)
if (e==1)
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in Conversor (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in @(hObject,eventdata)Conversor('con_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Los argumentos que le paso a mis funciones son 'dato' y 's'.
Les agradecería que me dijeran dónde está mi error y cómo solucionarlo.
Valora esta pregunta


0