Mu Analysis and Synthesis Toolbox | ![]() ![]() |
Generate a random complex CONSTANT, SYSTEM or VARYING matrix
Syntax
out
=crand
(n
,m
)out
=crandn
(n
,m
)sys
=sysrand
(nstates
,ninputs,noutputs,stabflag
) vary =varyrand
(rdim,cdim,nindv,ivflg
)
Description
crand
and crandn
generate random complex matrices of dimensions n
x m
, using the MATLAB rand
and randn
commands, respectively. crand
elements are uniformly distributed and crandn
elements are normally distributed.
n |
number of rows of the output matrix |
m |
number of columns of the output matrix |
out |
an n x m complex matrix of random elements |
sysrand
generates a random SYSTEM matrix with nstates
states, ninputs
inputs, and noutputs
outputs. Setting the stabflag
to 1 will result in a stable, random SYSTEM. The default for stabflag
is 0.
varyrand
creates a random VARYING matrix with a specified number of rows (rdim
), columns (cdim
), and independent variable values (nindv
). The optional argument ivflg
sorts the independent variables to be monotonically increasing if it is set to 0 (default). Otherwise, if ivflg
is set to a nonzero value, no sorting is done.
Examples
Create a CONSTANT, complex random matrix and a random SYSTEM matrix using the commands crand
and sysrand
crand
(4,3) ans = 0.4764 + 0.1622i 0.9017 + 0.1351i 0.4103 + 0.4523i 0.3893 + 0.0711i 0.4265 + 0.7832i 0.1312 + 0.8089i 0.2033 + 0.3653i 0.1420 + 0.4553i 0.8856 + 0.9317i 0.0284 + 0.2531i 0.9475 + 0.3495i 0.0922 + 0.6516i sys=sysrand
(2,4,1); seesys(sys) 0.2190 0.6789 | 0.9347 0.5194 0.0346 0.5297 0.0470 0.6793 | 0.3835 0.8310 0.0535 0.6711 ------------------|---------------------------------------- 0.0077 0.3834 | 0.0668 0.4175 0.6868 0.5890
See Also
minfo
, pck
, pss2sys
, rand
, randel
, sys2pss
, unpck
, vpck
, vunpck
![]() | cos_tr, sin_tr, step_tr | csord | ![]() |