You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Creates a number of samples from a specified number of dimensions and centers them around a given mean, and within a given covariance range. You might not find it very useful, but hey, I need something to do this so why not.
To use:
You need to generate 1000 samples from a 3 dimensional Gaussian distribution with a mean m = [4,5,6], and with a covariance sigma = [9 0 0;0 9 0;0 0 9].
Command line:
x=mgd(1000,3,m,sigma) or x=mgd(1000,3,m',sigma)
it doesn't matter if the mean is given as a row or column vector
x is a (1000x3) matrix of the where
where each row is the coordinates of that point in 3 space.
Cite As
Timothy Felty (2026). Multivariate Gaussian Distribution (https://uk.mathworks.com/matlabcentral/fileexchange/5984-multivariate-gaussian-distribution), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired: Gaussian Random Samples Generation
General Information
- Version 1.0.0.0 (2.05 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 | Added some error checking that was lacking. Updated to gracefully handle the one sample issue. Updated the comments. |
