MATLAB: Play Video in MATLAB GUI with other Objects

guivideo

Hi, all. I'm starting an experiment where I need to have a video window, as well as a number of text boxes and buttons in a single GUI window. Is this possible? Does anyone have any example code or suggestions on how I might be able to embed the video into the GUI and control it?
Thank you kindly.
Bill

Best Answer

function main(var_3D)
if nargin<1, var_3D=randn(100,100,100);end
[R,C,Frame]=size(var_3D);
h_play=uicontrol('style','pushbutton','callback',@play_var,'string','play');
h_text1=uicontrol('style','edit','string','edit1','position',[200 20 80 20]);
h_text2=uicontrol('style','edit','string','edit2','position',[300 20 80 20]);
function play_var(hObject,events)
for f=1:Frame
imshow(var_3D(:,:,f));
title(['frame ' int2str(f)]);
drawnow;
end
end
end