MATLAB Answers

Does the Live Editor support figure animations?

26 views (last 30 days)
I would like to know if the Live Editor supports figure animations.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Aug 2019
Edited: MathWorks Support Team on 21 Aug 2019
From R2019a, Live Editor supports the animation feature.
To enable this feature, please run the following command.
settingsObj = settings;
settingsObj.matlab.editor.AllowFigureAnimation.TemporaryValue = 1;
In R2018b and previous version, please refer the followings.
it is not supported. You can, however, double-click the figures within the Live Editor to get a full figure window with full graphics capabilities.


Sign in to comment.

More Answers (1)

Arjun Nair
Arjun Nair on 14 May 2019
As of 19a release, Live Editor does support figure animations. But it has to be enabled via a setting.
Please use the following setting to get figure animations in live editor:
s = settings;
s.matlab.editor.AllowFigureAnimation.TemporaryValue = 1
You can also refer the doc page and search for AllowFigureAnimation:


yao gang
yao gang on 29 May 2019
Hi, it seems this setting changes something.
The example in the release notes runs well, but with the settings if I run the code :
s = settings;
s.matlab.editor.AllowFigureAnimation.TemporaryValue = 1
a = [-0.5572,-0.7814;0.7814,0];
b = [1,-1;0,2];
c = [1.9691,6.4493];
sys = ss(a,b,c,0);
It successfully shows the plot, but throws some errors:
Error using DynamicSystem/step (line 95) Array indices must be positive integers or logical values.
If I run :
s = settings;
s.matlab.editor.AllowFigureAnimation.TemporaryValue = 1
Z = peaks;
axis tight manual
ax = gca;
ax.NextPlot = 'replaceChildren';
loops = 40;
F(loops) = struct('cdata',[],'colormap',[]);
for j = 1:loops
X = sin(j*pi/10)*Z;
F(j) = getframe;
it show the errors:
Dot indexing is not supported for variables of this type.
Error in
Error in alternatePrintPath
Error in alternatePrintPath
Error in alternatePrintPath
Error in alternateGetframe
Error in alternateGetframe
Error in getframe (line 136)
x = alternateGetframe(parentFig, offsetRect, scaledOffsetRect, includeDecorations);
Anything wrong?
Adam Wyatt
Adam Wyatt on 30 Jun 2020
There does not seem to be any problem with your code, technically speaking. You don't need to use drawnow and getframe - the latter will force a redraw. Using R2020a (at possibly earlier), drawnow is sufficient to cause the redraw within the live editor (and thus perform the desired animation), getframe should be reserved for when you want to explicitly use the frame (e.g. to generate a movie to save to file).

Sign in to comment.

Translated by