GUI Listbox
Publicado por Angela (4 intervenciones) el 06/03/2014 09:14:18
Hola a todos y gracias de antemano.
Estoy haciendo una GUI en Matlab y quiero que seleccionar un valor en una listbox y que ese valor se exporte a un archivo excel cuando pase a la siguiente "pantalla".
Lo había hecho así, pero no me funciona:
function RFuente1_Callback(hObject, eventdata, handles)
% hObject handle to RFuente1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
index_selected = get(hObject,'Value');
index_selected_texto=get(hObject, 'String');
handles.RFuente1=index_selected_texto;
guidata(hObject, handles);
function Siguiente_Callback(hObject, eventdata, handles)
% hObject handle to Siguiente (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
RFuente1= handles.RFuente1;
A={'Fuente';RFuente1};
xlswrite('situacion.csv',A,'B1:B2');
clear,clc,close all
D16;
Muchas gracias a todos,
Ángela
Estoy haciendo una GUI en Matlab y quiero que seleccionar un valor en una listbox y que ese valor se exporte a un archivo excel cuando pase a la siguiente "pantalla".
Lo había hecho así, pero no me funciona:
function RFuente1_Callback(hObject, eventdata, handles)
% hObject handle to RFuente1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
index_selected = get(hObject,'Value');
index_selected_texto=get(hObject, 'String');
handles.RFuente1=index_selected_texto;
guidata(hObject, handles);
function Siguiente_Callback(hObject, eventdata, handles)
% hObject handle to Siguiente (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
RFuente1= handles.RFuente1;
A={'Fuente';RFuente1};
xlswrite('situacion.csv',A,'B1:B2');
clear,clc,close all
D16;
Muchas gracias a todos,
Ángela
Valora esta pregunta


0