Getting value of selected string in Popup menu.
Mostra commenti meno recenti
I am trying to make a GUI. Depending on the option selected in popup menu 3 the selected operation should be performed on images. However when i am trying to get the value from popupmenu3 I am getting the following error.
Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)pr('popupmenu3_Callback',hObject,eventdata,guidata(hObject)).
Below is the code for this popupmenu.
function popupmenu3_Callback(hObject, eventdata, handles)
contents = get(hObject,'String');
a = contents{get(hObject,'Value')} ;
% --- Executes during object creation, after setting all properties.
function popupmenu3_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: popupmenu controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
When I make a simple GUI with only popupmenus I don't get the error. But when I try to get the value of selected string I am getting error.
4 Commenti
Image Analyst
il 1 Mag 2017
Attach your m and fig files.
Sidra Aleem
il 2 Mag 2017
Modificato: Sidra Aleem
il 2 Mag 2017
per isakson
il 2 Mag 2017
Modificato: per isakson
il 2 Mag 2017
- You should always show the entire error message.
- See Debug a MATLAB Program
- This folder name looks strange to me
127 cd(handles.Dir.Functions_Dir)
K>> handles.Dir.Functions_Dir
ans =
D:\ÎÒµÄÎĵµ\MATLAB\Image Processing\Functions\
K>>
Sidra Aleem
il 2 Mag 2017
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su 文件操作 in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!