Skip to Main Content Skip to Search
Product Documentation

TimeBegin, TimeEnd, TimeRange, InitialTimetime of the animation

TimeBegin = t0 defines the starting time t0 of the animation of an object.

TimeEnd = t1 defines the time t1 for the end of the animation.

TimeRange = t_0..t_1 is a short cut for setting both TimeBegin = t0 and TimeEnd = t1.

InitialTime = t2 defines the time t2 for the initial position of the animation slider.

→ Examples

Attribute

Type

Value

See Also:

AnimationStyle, Frames, ParameterBegin, ParameterEnd, ParameterName, ParameterRange, VisibleAfter, VisibleAfterEnd, VisibleBefore, VisibleBeforeBegin, VisibleFromTo

See Also:

See section Graphics and Animations in this document. In particular, see subsections The Number of Frames and the Time Range and Advanced Animations: The Synchronization Model for details on TimeBegin, TimeEnd, TimeRange, InitialTime.

Details:

The attributes VisibleAfter, VisibleBefore, and VisibleFromTo implicitly set values for TimeBegin and TimeEnd (and, therefore, also for TimeRange). Consequently, these attributes should not be used simultaneously in the definition of an animated object.

Example 1

By default, an animation plays for 10 seconds. Keeping the default value 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)):

MuPAD graphicsimage

The total time of the animation is the difference between TimeEnd and TimeBegin. Hence, the following animation plays 5 seconds as well:

plot(plot::Function2d(sin(a*x), x = -PI..PI, a = -PI..PI,
                      TimeRange = 5..10)):

MuPAD graphicsimage

Example 2

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):

MuPAD graphicsimage

Both functions are visible outside the time range of their animations. We use the attributes VisibleAfterEnd and VisibleBeforeBegin to make them visible only during their animations:

f1::VisibleAfterEnd := FALSE:
f2::VisibleBeforeBegin := FALSE:
plot(f1, f2):

MuPAD graphicsimage

delete f1, f2:

Example 3

The following animation uses the implicitly given TimeRange from 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):

MuPAD graphicsimage

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS