chgTimeUnit
Change time units of dynamic system
Description
changes the
time units of sys_new
=
chgTimeUnit(sys
,newtimeunits
)sys
to newtimeunits
without
modifying system behavior. The time- and frequency-domain characteristics of
sys
and sys_new
match.
Examples
Change Time Units of Dynamic System Model
Create a transfer function model.
num = [4 2]; den = [1 3 10]; sys = tf(num,den);
By default, the time unit of sys
is 'seconds'
. Create a new model with the time units changed to minutes.
sys1 = chgTimeUnit(sys,'minutes');
This command sets the TimeUnit
property of sys1
to 'minutes'
, without changing the dynamics. To confirm that the dynamics are unchanged, compare the step responses of sys
and sys1
.
stepplot(sys,'r',sys1,'y--'); legend('sys','sys1');
The step responses are the same.
If you change the TimeUnit
property of the system instead of using chgTimeUnit
, the dynamics of the system do change. To see this, change the TimeUnit
property of a copy of sys
and compare the step response with the original system.
sys2 = sys; sys2.TimeUnit = 'minutes'; stepplot(sys,'r',sys2,'gx'); legend('sys','sys2');
The step responses of sys
and sys2
do not match. For example, the original rise time of 0.04 seconds changes to 0.04 minutes.
Input Arguments
sys
— Dynamic system model
dynamic system model
Dynamic system model, specified as one of the following model types: numeric LTI models, sparse state-space models, LTV and LPV models, and generalized LTI models. For information regarding specific model types see Dynamic System Models.
newtimeunits
— New units of time
'seconds'
(default) | 'nanoseconds'
| 'microseconds'
| 'milliseconds'
| 'minutes'
| 'hours'
| 'days'
| 'weeks'
| 'months'
| 'years'
New time units, specified as one of the following values:
'nanoseconds'
'microseconds'
'milliseconds'
'seconds'
'minutes'
'hours'
'days'
'weeks'
'months'
'years'
Output Arguments
sys_new
— Dynamic system model
dynamic system model
Dynamic system model of the same type as
sys
. The time response of sys_new
is the
same as sys
.
Version History
Introduced in R2011a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)