How can i program my push button named "Back?

조회 수: 1 (최근 30일)
Misrak Seifu
Misrak Seifu 2014년 6월 3일
댓글: Misrak Seifu 2014년 6월 3일
How can i code my "back" push button. so that is shows me the images one by one backwards if i want to go back. Because i have a next push button too.
Thank you
  댓글 수: 4
Mahdi
Mahdi 2014년 6월 3일
So let's say you put the names of the images all in one string called Images1 (for example), you can set a counter in the opening function of the GUI where i=1. Now, when you load an image, you will access Images1(i,:) (or however you formatted it). Whenever you press next, you can tell i=i+1. Similarly, when you press back, you can tell i=i-1 to access the previous image. At least that's one way of approaching it. You will have to reload every image once you press that button and put it back on the axes.
Depending on how you want to save it, you can use savefig, imwrite, etc...In the filename argument, you can simply tell it where to write it, for example:
filename=strcat('C:\SomeFile', 'Picture_Name') #C:\SomeFile is where I want to save the image
savefig(filename)
Misrak Seifu
Misrak Seifu 2014년 6월 3일
Thanks that help a little but let me attach you the code i got, it's a bit different how i am loading my images.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by