Image is displaying in different axes
Hi, I have a problem dispalying an image in a certain axes(axes4, btw). Everytime I click a certain option in the pop-up menu/list it always displays in axes5(additionally, it always displays on axes that are newly added or created, in my instance its axes5). Please do help Hoiw I do this.
Here is my code snippet…..
% — Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,’String’)) returns popupmenu2 contents as cell array
% contents{get(hObject,’Value’)} returns selected item from popupmenu2
str = get(hObject, ‘String’);
val = get(hObject, ‘Value’);
% set current filter to the user-selected filter
switch str{val};
case ‘RED’
a = imread(‘C:UsersVinsMATLAB_SAMPLE_FolderMatlabcontrast.jpeg’);
b = imagesc(a(:,:,1));
image(handles.axes4, b)
axis(handles.axes4, ‘image’, ‘off’);
case ‘BLUE’
case ‘GREEN’
endHi, I have a problem dispalying an image in a certain axes(axes4, btw). Everytime I click a certain option in the pop-up menu/list it always displays in axes5(additionally, it always displays on axes that are newly added or created, in my instance its axes5). Please do help Hoiw I do this.
Here is my code snippet…..
% — Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,’String’)) returns popupmenu2 contents as cell array
% contents{get(hObject,’Value’)} returns selected item from popupmenu2
str = get(hObject, ‘String’);
val = get(hObject, ‘Value’);
% set current filter to the user-selected filter
switch str{val};
case ‘RED’
a = imread(‘C:UsersVinsMATLAB_SAMPLE_FolderMatlabcontrast.jpeg’);
b = imagesc(a(:,:,1));
image(handles.axes4, b)
axis(handles.axes4, ‘image’, ‘off’);
case ‘BLUE’
case ‘GREEN’
end Hi, I have a problem dispalying an image in a certain axes(axes4, btw). Everytime I click a certain option in the pop-up menu/list it always displays in axes5(additionally, it always displays on axes that are newly added or created, in my instance its axes5). Please do help Hoiw I do this.
Here is my code snippet…..
% — Executes on selection change in popupmenu2.
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved – to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,’String’)) returns popupmenu2 contents as cell array
% contents{get(hObject,’Value’)} returns selected item from popupmenu2
str = get(hObject, ‘String’);
val = get(hObject, ‘Value’);
% set current filter to the user-selected filter
switch str{val};
case ‘RED’
a = imread(‘C:UsersVinsMATLAB_SAMPLE_FolderMatlabcontrast.jpeg’);
b = imagesc(a(:,:,1));
image(handles.axes4, b)
axis(handles.axes4, ‘image’, ‘off’);
case ‘BLUE’
case ‘GREEN’
end image processing, axes, guide, matlab gui MATLAB Answers — New Questions