tags:

views:

29

answers:

2

how is possible to add a slider to control playback of a movie made from several plots so that each step of slider show one plot(frame) of that movie?

A: 

There is a nice submission on File Exchange - Scrolling Plot Demo.

It's not exactly what you need, but the code might be helpful.

It creates a horizontal slider under a plot to browse through a range of values. If you can get your frames into MATLAB you can associate the slider with frame index.

yuk
+1  A: 

I assume you are working with a GUIDE created GUI and that the the slider is tagged slider1. In this case you should take care of the following items.

First make sure that the slider's value, min, max and sliderstep properties are set properly. this should be done in either the GUI's opening function or when you load your frames into your GUI.

set(handles.slider1, ...
    'value',1, ...
    'max',numberOfFrames, ...
    'min',1, ...
    'sliderstep',[1 1]/numberOfFrames)`

This could be done in the Opening function (or in the callback that loads your frames into the GUI).

Then edit the slider's callback function to update the axes with the frame that corresponds to the slider's current value:

currentFrame = get(hObj,'value');
dat=GetFrameData(currentFrame);
%# Plot frame data as appropriate in your axis.
Azim

related questions