Chapter 2 Linear System Representation
© National Instruments Corporation 2-11 Xmath Control Design Module
these polynomials into a transfer-function and uses period( ) to set the
sampling interval to match that of sys4.
Example 2-6 Using period( ) to Extract the Sampling Period
[num,den]=numden(sys4);
H4 = system(num,den,{dt = period(sys4)})
H4 (a transfer function) =
-0.75
-----------
(z2 + 0.75)
System is discrete, sampling at 0.5 seconds.
check( ) provides a more concise means of converting between
state-space and transfer function form, as described in the Using check( )
with System Objects section, but this example illustrates how the output of
one function can be specified directly as keyword input to another.
names( )[outputNames,inputNames,stateNames] = names(Sys)
The names( ) function extracts matrices of strings representing the input,
output, and (if the system is in state space form) state names of a system.
names( ) also can be used to extract information from the PDM and
polynomial objects. More information on these functions can be found in
the MATRIXx Help.
When you create a system without specifying any names, a default set of
names are assigned to it. Unlike user-specified names, these default names
are not displayed in the Xmath Commands window. However, all, or any
subset of the names you select to store with the system still can be extracted
using names( ) as shown in Example 2-7.
Example 2-7 Using names( ) to Extract the Variable Names Associated with a System
H3 = system(makepoly([2,-1],"s"),
makepoly([1,6,8],"s"));
[outputNames, inputNames] = names(H3)
outputNames (a string) = Output 1
inputNames (a string) = Input 1
sys5=system([0,1;-0.75,0],[1,0]',[0,1],0,{dt=0.5,
inputNames = "Current",