Created
February 13, 2018 11:47
-
-
Save guillego/340f75161c29932d92d554abeeb0c569 to your computer and use it in GitHub Desktop.
Matlab save to gif
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% This runs within the for loop that iterates between stages of image | |
% GIF | |
drawnow | |
% Capture the plot as an image | |
frame = getframe(h); | |
im = frame2im(frame); | |
[imind,cm] = rgb2ind(im,256); | |
% Write to the GIF File | |
if this_pulse == 1 | |
imwrite(imind,cm,filename,'gif', 'Loopcount',inf); | |
else | |
imwrite(imind,cm,filename,'gif','WriteMode','append'); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment