// animation_point_animaGIF.sce

clear; xdel(winsid());

// Create motion data
t = 0:0.01:1;    // Time data
x = sin(2*%pi*t); // Position data

// Draw initial figure
h_fig = figure;
h_fig.background = 8;
drawlater();
h_point = plot(x(1), 0, 'Marker', 'o', 'MarkerSize', 20,..
    'MarkerEdgeColor', 'blue', 'MarkerFaceColor', 'blue');
h_axes = gca();
h_axes.data_bounds = [-1.5, -1.5; 1.5, 1.5];

// Initiate animated GIF
outgif = 'animation_point_scilab.gif';
mdelete(outgif);
idGif = animaGIF(gcf(), outgif, 10, 0);

// Animation Loop
for i = 1:length(x)
    drawlater();
    h_point.data = [x(i), 0];
    drawnow();
    
    // Add snapshot to animated GIF
    idGif = animaGIF(gcf(), idGif);
end

// Close animated GIF
animaGIF(idGif);