Animated sequence of dots
8 views (last 30 days)
Show older comments
Hello
I would like to know if Matlab can easily do this: set a animated sequence of dots that will appear at specific location on a 2 wire-frame surface or cube. The sequence will be generated with precise sequence or randomly etc. If it is possible is there any example of such sequence or what kind of code i should use?
see the image attached
Kind Regards and thanks
Xav
3 Comments
Accepted Answer
Walter Roberson
on 24 Jul 2015
For earlier versions you can use scatter() or plot(), updating the XData and YData properties as you go. For example,
x = []; y = [];
pointsize = 30;
h = scatter(x, y, pointsize, 'k');
for K = 1 : 20
newx = rand(); newy = rand();
x(end+1) = newx;
y(end+1) = newy;
set(h, 'XData', x, 'Ydata', y);
drawnow();
end
More Answers (0)
See Also
Categories
Find more on Animation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!