RolandRitt/Matlab-genNoisyData

Version 1.1.0.0 (31.2 KB) by Roland
generate data with given covariance matrix
34 Downloads
Updated 4 Jul 2017

# Matlab-genNoisyData
function to generate a dataset with m realisations of a random d-dimensional variable with given covariance matrix
```Matlab
function dataM = genCovData(covM, m, y0)
% Keywords: covariance, random data, noisy data
%
% Purpose : generate a data set with m random data vectors with a
% exactly the predefined covariance matrix 'covM'; optional a
% datavector can be given to generate a noisy data set for. In
% this case the generated noise is added to y0
%
% Syntax : dataM = genCovData(covM, m)
% dataM = genCovData(covM, m, y0)
%
% Input Parameters :
% covM := covariancematrix of the output; a squared symmetric
% positiv semi-definit matrix; dimension d of the matrix is the
% dimension of the random data vector
%
% m := number of realisations of random data vector;
%
% y0 := a column vector of size [dx1]; to this vector, the
% generated noise with given covariance is added.
%
%
% Return Parameters :
% dataM := a matrix of size [dxm], where each column is a
% realisation of the random variable; the covariance (cov(dataM')
% is the given covM;
%
% Description :
% using code from:
% https://stats.stackexchange.com/questions/120179/generating-data-with-a-given-sample-covariance-matrix
% see also: mvnrnd
% Author :
% Roland Ritt
%
% History :
% \change{1.0}{29-Jun-2017}{Original}
%
% --------------------------------------------------
% (c) 2017, Roland Ritt
% Chair of Automation, University of Leoben, Austria
% email: automation@unileoben.ac.at
% url: automation.unileoben.ac.at
% --------------------------------------------------
```

Cite As

Roland (2024). RolandRitt/Matlab-genNoisyData (https://github.com/RolandRitt/Matlab-genNoisyData), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2017a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Creating and Concatenating Matrices in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

mCode

testCode

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes
1.1.0.0

add optional input parameter y0 to generate a noisy data set for y0

1.0.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.