Info

This question is closed. Reopen it to edit or answer.

control button separately

1 view (last 30 days)
Pan
Pan on 25 Feb 2012
Closed: MATLAB Answer Bot on 20 Aug 2021
Hellow everyone,
I want to ask about control button's question.
This is my code
clear all;
obj = mmreader('watch.avi');
obj1 = mmreader('can.avi');
obj2 = mmreader('phone.avi');
obj3 = mmreader('book.avi');
vid = read(obj);
vid1 = read(obj1);
vid2 = read(obj2);
vid3 = read(obj3);
%for frame = 1 : size(vid,4)
% bw = im2bw(vid(:,:,:,frame));
frame = 1;
frame1 = 50;
frame2 = 30;
frame3 = 1;
f4 = 1;
while (1)
subplot(2,2,2); imshow(vid(:,:,1,frame));
if frame < size(vid,4)
frame = frame+1;
else frame = 1;
end
subplot(2,2,1); imshow(vid1(:,:,:,frame1));
if frame1 < size(vid1,4)
frame1 = frame1+1;
else frame1 = 1;
end
subplot(2,2,3); imshow(vid2(:,:,2,frame2));
if frame2 < size(vid,4)
frame2 = frame2+1;
else frame2 = 1;
end
subplot(2,2,4); imshow(vid3(:,:,:,frame3));
if frame3 < size(vid1,4)
frame3 = frame3+1;
else frame3 = 1;
end
drawnow;
if f4 > 500
break;
else f4 = f4+1;
end
end
then,I want to use button that control video.
Everyone video has two buttons(play,stop), so I have four videos,I must have eight buttons that control video,and set up one button controling "close" figure.
So,total of nine buttons,I must how to do.
please give me advice.Thanks!
  2 Comments
Oleg Komarov
Oleg Komarov on 25 Feb 2012
Please format it: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
Walter Roberson
Walter Roberson on 25 Feb 2012
You do not need separate play and stop buttons: you can use a single "radio button" that changes labels between "play" and "stop".

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!