how to pass variable from popup menu to button?
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 6 de Jun. de 2015
0 votos
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!