ListBox error - existent field
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi I have a problem, I wanted to let the selected folder names DICOM file appears in the listbox. But Hals me an error:
??? References to non-existent field 'ListBox'.
Error in ==> load at 35
set (handles.ListBox, 'String', char (dfiles.name), 'value', 1);
Does anybody know how to do it? Thank you very much.
h1=figure;
ListBox=uicontrol('Units','Normalized','Position',[0.01 0.1 0.1 0.15],...
'Style','List');
P=fileparts(mfilename('fullpath'));
nfolder=uigetdir(P,'cokoliv');
handles.dfolder=nfolder;
handles.dfolder=nfolder;
dfiles=dir(handles.dfolder);
dfiles=dfiles(3:end);
set(handles.ListBox,'String',char(dfiles.name),'value',1);
fname=get(handles.ListBox,'String');
fname=fname(get(handles.ListBox,'value'),:);
img=dicomread([dfolder '\' fname]);
imagesc(img);
0 comentarios
Respuesta aceptada
Sean de Wolski
el 8 de Feb. de 2012
handles =
dfolder: 'H:\Documents\MATLAB'
It does not have a field ListBox. You can either make listbox a field
handles.ListBox = uicontrol(...
Or call get/set directly with ListBox
get(ListBox,'...
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!