%% Create Animation in UI Figure
% Create a UI figure. Specify the UI axes of the figure.

fig = uifigure;
ax = uiaxes(fig);

%
% Add an animation object to the UI axes using fanimator. Create two symbolic variables, x and t. Plot a curve that grows exponentially as a function of time t within the interval [0 3].

syms x t;
fanimator(ax,@fplot,exp(x),[0 t],'r','AnimationRange',[0 3])

%
% Play the animation in the UI figure fig by entering the command playAnimation(fig). Alternatively, you can also use the command playAnimation(ax.Parent).
%
% Copyright 2018 The MathWorks, Inc.