matlab gui image changing
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Fco. Javier Rodríguez Mira
am 25 Mai 2020
Kommentiert: Fco. Javier Rodríguez Mira
am 28 Mai 2020
Hi, i'm trying to make a gui that changes an image with the value of a vector, I mean, i've got a vector that has 0, 1 and 2 values and i need to show an image for each value. Can be possible?
Antworten (1)
Ajay Pattassery
am 28 Mai 2020
Hello,
I am not sure, whether you are looking for this. I just read three images and display them for a duration of 1second and show the other image based on the value in the vectorInput.I have a one to one mapping between vectorInput values 0,1,2 with img0,img1 and img2.
img0 = imread('membrane.png');
img1 = imread('peppers.png');
img2 = imread('football.jpg');
vectorInput = [0 0 1 2 2 0];
f= uifigure();
img =uiimage(f);
for i=1:length(vectorInput)
if(vectorInput(i) == 0)
img.ImageSource = img0;
elseif(vectorInput(i) == 1)
img.ImageSource = img1;
else
img.ImageSource = img2;
end
pause(1);%Holding image for 1 second
end
Siehe auch
Kategorien
Mehr zu Get Started with Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!