animate
Line spiral
op = struct('show', false, 'showCanvas', false, 'markerSize', 3, 'xAxisMin', -160, 'xAxisMax', 190, 'yAxisMin', -180, 'yAxisMax', 150, 'zAxisMin', 10, 'zAxisMax', 160) z = [] j = 1 for i = 10*(1:pi/8:5*pi) z = [z, i] y = z.*sin(z/10) x = z.*cos(z/10) c{j} = plot3(x, y, z, op) j = j +1 end animate(c, struct('timelapse', 70))
Projectile motion
o = struct('width', 700, 'xAxisMax', 2.6, 'yAxisMax', 0.7, 'show', false, 'markerFill', 'red') n = 35 c = cell(n, 1) dt = 1/50 g = 9.81 theta0 = 45*pi/180 v0 = 5 x = 0 y = 0 t = (1:n)*dt x = v0*t*cos(theta0) y = v0*t*sin(theta0) - 0.5*g*t.^2 for i = 1: n c{i} = scatter(x(1:i),y(1:i),o) end animate(c, struct('timelapse', 50))
Table as input
First column elements will be taken as titles for each frame.
city = {'Otawa';'Kingston';'Bonavista'} minTemp = [-15.1;-12.6;-7.4] average = [-10.7;-8;-4.2] maxTemp = [-6.4;-3.5;-1.2] t1 = table(city,minTemp,average,maxTemp,'VariableNames',{'city','minTemp','average','maxTemp'}) animate(t1)