
Ayuda gui en Matlab
Publicado por Alan Rafael (7 intervenciones) el 26/07/2014 19:37:46
Buenas
He trabajado en Matlab manejo funciones. Hace poco desarrolle un programa para realizar calculo mediante scrpit con lo transforme en una función. Hasta ese momento todo bien. Ahora que realice un GUI para ingresar los datos y mostrar los valores de los resultados, no logro ejecutar los programas me salen errores. Tengo la siguiente funcion:
Como función se ejecuta bien. Y la llamo de la siguiente manera en la GUI de matlab
Al ejecutar la GUI y activar el pushbutton matlab me arroja el siguiente mensaje:
Agradezco cualquier ayuda de antemano con este problema.
He trabajado en Matlab manejo funciones. Hace poco desarrolle un programa para realizar calculo mediante scrpit con lo transforme en una función. Hasta ese momento todo bien. Ahora que realice un GUI para ingresar los datos y mostrar los valores de los resultados, no logro ejecutar los programas me salen errores. Tengo la siguiente funcion:
function [Vp,Vc]=voltaje(peso,tf,Rt,Rs,hs)
C=1-((0.09*(1-Rt/Rs))/(2*hs+0.09));
if peso==50
Vp=(1000+6*C*Rs)*(.116/sqrt(tf));
Vc=(1000+1.5*C*Rs)*(.116/sqrt(tf));
end
if peso==70
Vp=(1000+6*C*Rs)*(.157/sqrt(tf));
Vc=(1000+1.5*C*Rs)*(.157/sqrt(tf));
end
C=1-((0.09*(1-Rt/Rs))/(2*hs+0.09));
if peso==50
Vp=(1000+6*C*Rs)*(.116/sqrt(tf));
Vc=(1000+1.5*C*Rs)*(.116/sqrt(tf));
end
if peso==70
Vp=(1000+6*C*Rs)*(.157/sqrt(tf));
Vc=(1000+1.5*C*Rs)*(.157/sqrt(tf));
end
Como función se ejecuta bien. Y la llamo de la siguiente manera en la GUI de matlab
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)
peso=str2double(get(handles.popupmenu1,'String'));
Rs=str2double(get(handles.edit5,'String'));
Rt=str2double(get(handles.edit6,'String'));
hs=str2double(get(handles.edit19,'String'));
tf=str2double(get(handles.edit20,'String'));
[Vp,Vc]=voltaje(peso,tf,Rt,Rs,hs);
set(handles.edit8,'String',Vp);
set(handles.edit9,'String',Vc);
% 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)
peso=str2double(get(handles.popupmenu1,'String'));
Rs=str2double(get(handles.edit5,'String'));
Rt=str2double(get(handles.edit6,'String'));
hs=str2double(get(handles.edit19,'String'));
tf=str2double(get(handles.edit20,'String'));
[Vp,Vc]=voltaje(peso,tf,Rt,Rs,hs);
set(handles.edit8,'String',Vp);
set(handles.edit9,'String',Vc);
Al ejecutar la GUI y activar el pushbutton matlab me arroja el siguiente mensaje:
Error in voltaje (line 2)
C=1-((0.09*(1-Rt/Rs))/(2*hs+0.09));
Output argument "Vp" (and maybe others) not assigned during call to
"C:\Users\user\Documents\MATLAB\voltaje.m>voltaje".
Error in GUIAFBT>pushbutton4_Callback (line 496)
[Vp,Vc]=voltaje(peso,tf,Rt,Rs,hs);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in GUIAFBT (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)GUIAFBT('pushbutton4_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
C=1-((0.09*(1-Rt/Rs))/(2*hs+0.09));
Output argument "Vp" (and maybe others) not assigned during call to
"C:\Users\user\Documents\MATLAB\voltaje.m>voltaje".
Error in GUIAFBT>pushbutton4_Callback (line 496)
[Vp,Vc]=voltaje(peso,tf,Rt,Rs,hs);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in GUIAFBT (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)GUIAFBT('pushbutton4_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
Agradezco cualquier ayuda de antemano con este problema.
Valora esta pregunta


0