Main Content

time

Access global simulation time

Syntax

time

Description

You can access global simulation time from the equation section of a Simscape™ file using the time function.

time returns the simulation time in seconds.

Examples

The following component outputs y = sint):

component MyComp
  parameters
    w = { 1, '1/s' } % omega
  end
  outputs
    y = 0;
  end
  equations
    y == sin( w * time );
  end
end

Version History

Introduced in R2008b