Main Content

chgTimeUnit

Change time units of dynamic system

Syntax

sys_new = chgTimeUnit(sys,newtimeunits)

Description

sys_new= chgTimeUnit(sys,newtimeunits)changes the time units ofsystonewtimeunits. The time- and frequency-domain characteristics ofsysandsys_newmatch.

Input Arguments

sys

Dynamic system model

newtimeunits

New time units, specified as one of the following values:

  • 'nanoseconds'

  • 'microseconds'

  • 'milliseconds'

  • “秒”

  • 'minutes'

  • 'hours'

  • 'days'

  • 'weeks'

  • 'months'

  • 'years'

Default:“秒”

Output Arguments

sys_new

Dynamic system modelof the same type assyswith new time units. The time response ofsys_newis same assys.

Ifsysis an identified linear model, both the model parameters as and their minimum and maximum bounds are scaled to the new time units.

Examples

collapse all

Create a transfer function model.

num = [4 2]; den = [1 3 10]; sys = tf(num,den);

By default, the time unit ofsysis“秒”. Create a new model with the time units changed to minutes.

sys1 = chgTimeUnit(sys,'minutes');

This command sets theTimeUnitproperty ofsys1to'minutes', without changing the dynamics. To confirm that the dynamics are unchanged, compare the step responses ofsysandsys1.

stepplot(sys,'r',sys1,'y--'); legend('sys','sys1');

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent sys, sys1.

The step responses are the same.

If you change theTimeUnitproperty of the system instead of usingchgTimeUnit, the dynamics of the system do change. To see this, change theTimeUnitproperty of a copy ofsysand compare the step response with the original system.

sys2 = sys; sys2.TimeUnit ='minutes'; stepplot(sys,'r',sys2,'gx'); legend('sys','sys2');

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent sys, sys2.

The step responses ofsysandsys2do not match. For example, the original rise time of 0.04 seconds changes to 0.04 minutes.

Tips

  • UsechgTimeUnitto change the time units without modifying system behavior.

Version History

Introduced in R2012a

See Also

|(Control System Toolbox)|(Control System Toolbox)|(Control System Toolbox)|(Control System Toolbox)|(Control System Toolbox)||||

Topics