%% New in MATLAB R2022a: export graphics to animated GIFs
% Matlab Central Community Highlight
% March 22, 2022
% Author: Adam Danz
%
% Starting in MATLAB R2022a, use the append option in exportgraphics to create GIF files from animated axes, figures, or other visualizations.
% This basic template contains only two steps:
% % 1. Create the initial image file
% gifFile = 'myAnimation.gif';
% exportgraphics(obj, gifFile);
%
% % 2. Within a loop, append the gif image
% for i = 1:20
%
%     %   %   %   %   %   %    %
%     % Update the figure/axes %
%     %   %   %   %   %   %    %
%
%     exportgraphics(obj, gifFile, Append=true);
% end
% Note, exportgraphics will not capture UI components such as buttons and knobs and requires constant axis limits.
% To create animations of images or more elaborate graphics, learn how to use imwrite to create animated GIFs.
% Share your MATLAB animated GIFs in the comments below!
%% See Also
% Animation Techniques
% Animating plots
% Community Highlight Thumbnail
%
%
% This Community Highlight is attached as a live script.