Borrar filtros
Borrar filtros

save animation into gif

2 visualizaciones (últimos 30 días)
nirwana
nirwana el 31 de Mzo. de 2023
Respondida: Luca Ferro el 31 de Mzo. de 2023
hi...i wrote my function and making it as walking sine, and i'd like to save it as a gif. can anyone help me?
close all
t = linspace(0, 4*pi, 100);
y = sin(t);
yH=hilbert(y);
fig=figure
hold on
hl1 = plot(t, y);
hl2 = plot(t,0.5*imag(yH));
hl3 = plot(t,y+imag(yH));
camroll(90)
hold off
grid on
xlim tight
ylim padded
%hold on
for i=1:700
set(hl1, 'YData', circshift(get(hl1, 'YData'), 1));
set(hl2, 'YData', circshift(get(hl2, 'YData'), 1));
set(hl3, 'YData', circshift(get(hl3, 'YData'), 1));
drawnow
end

Respuestas (1)

Luca Ferro
Luca Ferro el 31 de Mzo. de 2023
use this function from file exchange:
I personally use it every now and then and it always work great

Categorías

Más información sobre Animation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by