Time of the animation
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
the starting time
the animation of an object.
t1 for the end
of the animation.
t_0 .. t_1 is
a short cut for setting both
t2 for the initial
position of the animation slider.
Animations are defined object by object. Each animated object
is animated for a certain time span specified by
the real start and end time in seconds.
The total real time span of an animated plot is the physical
real time given by the minimum of the
of all animated objects in the plot to the maximum of the
of all the animated objects:
When a plot containing animated objects is created,
the real time clock is set to the minimum of the
of all animated objects in the plot. The real time clock is started
when pushing the `play' button for animations in the graphical user
Before the real time reaches the
an animated object, this object is static in the state corresponding
to the begin of its animation. Depending on the attribute
it may be visible or invisible before
During the time from
the object changes from its original to its final state.
After the real time reaches the
the object stays static in the state corresponding to the end of its
animation. Depending on the attribute
may stay visible or become invisible after
The animation of the entire plot ends with the physical
time given by the maximum of the
of all animated objects in the plot.
If all animated objects in a plot share the same values
= t0 and
TimeEnd = t1,
the physical time span of the animation is
seconds). During this time, all animated objects change from their
initial to their final state.
Separate settings for
different animated objects allow to synchronize the animations.
With the optional attribute
initial position of the animation slider can be set to any time value
InitialTime is not set, the slider will be placed
at the beginning of the animation.
By default, an animation plays for 10 seconds. Keeping the default
TimeBegin = 0, this time can be reduced to
5 seconds by setting
TimeEnd = 5:
plot(plot::Function2d(sin(a*x), x= - PI .. PI, a = -PI..PI, TimeEnd = 5)):
The total time of the animation is the difference between
Hence, the following animation plays 5 seconds as well:
plot(plot::Function2d(sin(a*x), x = -PI..PI, a = -PI..PI, TimeRange = 5..10)):
Using different time ranges allows to synchronize the animations of different objects. Here we plot two functions. The first function is animated from 0 to 5 (seconds) and then stays static in its final state. The second function stays static in its initial state for 5 seconds and is then animated in the range from 5 to 10 (seconds):
f1 := plot::Function2d(a*sin(x), x = -PI..PI, a = -1..1, Color = RGB::Red, TimeRange = 0..5): f2 := plot::Function2d(a*cos(x), x = -PI..PI, a = -1..1, Color = RGB::Blue, TimeRange = 5..10): plot(f1 ,f2):
f1::VisibleAfterEnd := FALSE: f2::VisibleBeforeBegin := FALSE: plot(f1, f2):
delete f1, f2:
The following animation uses the implicitly given
0 to 10 seconds, but the first image shown is at the time 5:
plot(plot::Function2d(a*sin(x), x = -PI..PI, a = -1..1), InitialTime=5):