Mu Analysis and Synthesis Toolbox | ![]() ![]() |
Return, sort
, or append the independent variable values of a VARYING matrix
Syntax
[indv,err] = getiv(mat) getiv(mat) [out,err] = sortiv(mat,sortflg,nored,epp) out = tackon(mat1,mat2)
Description
getiv
returns the independent variable values of the VARYING matrix mat
. If the input matrix mat
is a VARYING matrix, the independent variable is returned as a column vector, indv
, and the output err
is set to 0. If mat
is not a VARYING matrix, then indv
is set to empty, and err
is set to 1.
sortiv
will reorder the independent variable and associated VARYING matrix to be monotonically increasing or decreasing. The optional sortflg
is set to 0 (default) for monotonically increasing sorting or nonzero for monotonically decreasing sorting. sortiv
can be used in conjunction with tackon
to mesh together two different VARYING matrices. The optional third input argument, nored
, is set to 0 (default) which does not reduce the number of independent variables even if there are repeated ones. Setting nored
to a nonzero value causes repeated independent variables to be collapsed down if their corresponding matrices are the same. If they are not, an error message is displayed and only the first independent variable and corresponding matrix is kept. The output argument err
, which is nominally 0, is set to 1 if an error message is displayed. The optional fourth input argument, epp
, is a vector used for checking closeness of two variables. If two independent variables are within epp(1)
, and the norm
of the difference between the two matrices at these points is within epp(2)
, sortiv
collapses these two independent variable values down to one. If the two independent variables are within epp(1)
, and the norm
condition is not satisfied, an error message is displayed and out
is set to the null matrix. When nored
is nonzero, the default value for epp
is [1e - 9;1e - 9].
tackon
strings together two VARYING matrices placing mat1
on top of mat2
. mat1
and mat2
must have the same row and column dimensions.
Examples
The frequency response VARYING matrix from the frsp
example is a two-input/two-output matrix containing 30 points. These independent variables vary from 0.1 rad/sec to 100 rad/sec.
minfo(sysg
) varying: 30pts
2 rows2 cols seeiv(sysg
) 1.000e-01 1.269e-01 1.610e-01 2.043e-01 2.593e-01 3.290e-01 4.175e-01 5.298e-01 6.723e-01 8.532e-01 1.083e+00 1.374e+00 1.743e+00 2.212e+00 2.807e+00 3.562e+00 4.520e+00 5.736e+00 7.279e+00 9.237e+00 1.172e+01 1.487e+01 1.887e+01 2.395e+01 3.039e+01 3.857e+01 4.894e+01 6.210e+01 7.880e+01 1.000e+02
getiv
without any arguments outputs a brief description of its calling sequence. All µ-Tools commands have this feature. The xtract
command selects the independent variables between 1 and 5 rad/sec and the getiv
command returns these independent variables from sysg
and stores them in indv
.
getiv usage: [indv,err] = getiv(mat) [indv] = getiv(xtract(sysg,l,5)); indv' ans = 1.0826 1.3738 1.7433 2.2122 2.8072 3.5622 4.5204
sortiv
command (with an optional second argument) resorts the independent variable of the frequency response of sys
in decreasing order.
syslg = sortiv (xtract ( sysg
,1 , 5 ) , 1 ) ;
seeiv(syslg)
4.520e+00 3.562e+00 2.807e+00 2.212e+00 1.743e+00
1.374e+00 1.083e+00
Algorithm
getiv
and sortiv
manipulate VARYING matrices.
See Also
indvcmp
, sort
, xtract
, xtracti
![]() | genmu | h2norm, hinfnorm | ![]() |