how to pass variable from popup menu to button?
Show older comments
function popupmenu1_Callback(hObject, eventdata, handles)
contents=get(hObject,'Value');
switch contents
case 1
rgbImage=imread('lion.jpg');
axes(handles.axes1);
imshow(rgbImage);
case 2
rgbImage=imread('dog.jpg');
axes(handles.axes1);
imshow(rgbImage);
case 3
rgbImage=imread('ondel-ondel.jpg');
axes(handles.axes1);
imshow(rgbImage);
case 4
rgbImage=imread('house.jpg');
axes(handles.axes1);
imshow(rgbImage);
case 5
rgbImage=imread('jungle.jpg');
axes(handles.axes1);
imshow(rgbImage);
otherwise
end
function pushbutton2_Callback(hObject, eventdata, handles)
redChannel = rgbImage(:, :, 1);
greenChannel = rgbImage(:, :, 2);
blueChannel = rgbImage(:, :, 3);
redFiltered = medfilt2(redChannel, [3,3]);
greenFiltered = medfilt2(greenChannel , [3,3]);
blueFiltered = medfilt2(blueChannel , [3,3]);
filteredRgbImage = cat(3, redFiltered , greenFiltered , blueFiltered );
axes(handles.axes2);
imshow(filteredRgbImage);
how to pass the rgbImage variable from popupmenu1 to pushbutton2?
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 6 Jun 2015
0 votes
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!