randvector (MathScript RT Module Function)
- Updated2023-03-14
- 2 minute(s) read
randvector (MathScript RT Module Function)
Owning Class: timeresp
Requires: Control Design and Simulation Module and MathScript RT Module
Syntax
vectorX = randvector(covXX)
vectorX = randvector(meanX, covXX)
[vectorX, vectorY] = randvector(covXX, covYY, covXY)
[vectorX, vectorY] = randvector(meanX, covXX, covYY, covXY)
[vectorX, vectorY] = randvector(meanX, meanY, covXX, covYY, covXY)
Legacy Name: randvec
Description
Generates one or more random vectors with specified mean, auto-covariance, and cross-covariance information.
Inputs
| Name | Description |
|---|---|
| covXX | Specifies the auto-covariance of the vectorX vector. covXX is a real matrix and must be symmetric and positive semi-definite. |
| meanX | Specifies the mean of the vectorX vector. meanX is a real vector and determines the length of vectorX and the dimensions of covXX. The default value of meanX is 0. |
| covYY | Specifies the auto-covariance of the vectorY vector. covYY is a real matrix and must be symmetric and positive semi-definite. |
| meanY | Specifies the mean of the vectorY vector. meanY is a real vector and determines the length of vectorY and the dimensions of covYY. The default value of meanY is 0. |
| covXY | Specifies the cross-covariance between the vectorX and vectorY vectors. covXY is a real matrix. If n is the length of meanX and m is the length of meanY, covXY must be an n x m matrix. |
Outputs
| Name | Description |
|---|---|
| vectorX | Returns a random vector with mean meanX, auto-covariance covXX, and cross-covariance covXY with the vectorY vector. |
| vectorY | Returns a random vector with mean meanY, auto-covariance covYY, and cross-covariance covXY with the vectorX vector. |
Details
The following table lists the support characteristics of this function.
| Supported in the LabVIEW Run-Time Engine | Yes |
| Supported on RT targets | Yes |
| Suitable for bounded execution times on RT | Not characterized |
Examples
eig_xy = abs(randn(1,7));
diag_xy = diag(eig_xy);
U_xy = rand(7,7);
overall_cov = U_xy*diag_xy*U_xy';
covXX = overall_cov(1:4,1:4);
covYY = overall_cov(5:7,5:7);
covXY = overall_cov(1:4,5:7);
[vectorX, vectorY] = randvector(covXX, covYY, covXY);