Matlab - Listbox en Matlab

 
Vista:

Listbox en Matlab

Publicado por Jules (1 intervención) el 27/08/2013 14:16:42
Hola, estoy trabajando en un gui de matlab, es un boton con dos listboxes. El boton caraga un directorio y carga tambien los nombres del directorio en la LISTBOX1. Luego al seleccionar unmbre en la LISTBOX1 esto carga un archivo .mat que contiene un solo numero en la LISTBOX2.

hasta ahora tdod funciona bien hasta la listbox 1, pero me sale un error cuando trato de cargar contenidos a la listbox 2. El codigo desde la listbox 1 a la 2 es algo asi:


function listbox1_Callback(hObject, eventdata, handles)
handles = guidata(hObject);
handles.output = hObject;
%store the selected station name from listbox as station (input for
%terracem scripts)
contents = cellstr(get(hObject,'String')); %returns stationslist contents as cell array
station_selection=char(contents{get(hObject,'Value')}) %returns selected item from stationslist
handles.statsel=station_selection;


%put profile names of profiles in next listbox/ new version
station=handles.statsel;
dirstations=handles.stationsdir;
%maindir=handles.maindir;
cd(dirstations)
cd(station)
sel=(handles.statsel);
load(sprintf('%s_swaths.mat',sel));
as=nim
af=(1:1:as)
a=num2cell(af)

%nameprof(ismember(nameprof,{'.','..'})) = [];
%nameprof=handles.proflist;

set(handles.listbox2,'string',a)


%save data
guidata(hObject, handles);



el problema esta cuanto hago el set(handles.listbox2)... me sale un error y dice que se hace referencia a un campo inexistente...

Reference to non-existent field
'listbox2'.

porque pasa esto?

como lo arreglo?

saludos
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder