How can i program my push button named "Back?

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 日
Are you saving the images in a matrix or different variables? You can always put a counter or put them in a string and then tell the counter to go to the previous image and re-execute the code.
Misrak Seifu
Misrak Seifu 2014 年 6 月 3 日
My images are in a folder, i am reading it from the folder but the folder will have at least 5,000 images. Because i am creating a gui with a lot of checkboxes. So what it does is. I load image into gui then i have checkboxes that will define the image, if it is single person, multiple person, white, black. So this choices will be in a different checkbox. So what i want to do is use a back push button if i want to go back to d pervious image.
And if it is not too much i couldn't figure how to save the images i processed in a different folder too
Thank you so muchchh!!!
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 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

タグ

質問済み:

2014 年 6 月 3 日

コメント済み:

2014 年 6 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by