how to pass variable from popup menu to button?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 6 Juin 2015
0 votes
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!