This GUI tool allows you to animate your data with controls for playback speed and looping.
The controls allows you to speed up and slow down (or reverse) the playback. You can pause at any time. You can also drag the time line bar to go to arbitrary frames. Also, use the arrow keys to move between frames (left or right) or change the speed (up or down). Spacebar pauses/starts the animation. In addition to the animation speed, the animation frame interval rate can be set from the menu.
The animation can be exported to an AVI or an Animated GIF (from the menu).
ANIMATOR(X, Y) animates the data. The data has to be in one of the following formats. The general form is a 3-D array. 1st dimension is the numbe of elements in a signal (m). 2nd dimension is the number of lines (n). 3rd dimension is the number of frames (p).
ANIMATOR(X, Y, PARAM1, VALUE1, ...) accepts additional arguments:
'axis' : {'auto'}, 'equal
'xlim' : 'auto', [XMIN, XMAX].
'ylim' : 'auto', [YMIN, YMAX].
'title' : <title text>
'xlabel': <xlabel text>
'ylabel': <ylabel text>
'smooth': {'off'}, 'on'. Anti-aliasing
Example:
x = (0:.01:10)';
y = nan(length(x), 2, 400);
for idx = 1:400;
y(:,1,idx)=sin(2*x)+cos(0.25*sqrt(idx)*x);
y(:,2,idx)=-cos(0.7*x)+sin(0.4*sqrt(idx)*x);
end
animator(x, y);
*NOTE 1* R14SP2 or later is needed for exporting to Animated GIFs.
*NOTE* This current version requires the Image Processing Toolbox for exporting to Animated GIFs. This is because it is calling "rgb2ind" for converting RGB to indexed image. A future enhancement will be to create a MATLABĀ®-only solution. |