MATLAB: Am I unable to use MVNRND on sparse matrices in MATLAB 7.2 (R2006a)

matricesmvnrndsparseStatistics and Machine Learning Toolbox

Why can I no longer pass a sparse matrix as an input argument to the function MVNRND. I could do this in previous versions of MATLAB, but this functionality no longer exists in MATLAB 7.2 (R2006a).

Best Answer

This enhancement has been incorporated in Release 2008b (R2008b). For previous product releases, read below for any possible workarounds:
There is a limitation in MATLAB 7.2 (R2006a) when using MVNRND with sparse matrices. The root cause of this issue is the inability of EPS to handle a sparse matrix. To work around this issue, download the attached version of the statchol.m MATLAB file. Here are the steps:
1. Quit MATLAB
2. Rename the following MATLAB file:
$MATLABROOT\\toolbox\stats\private\statchol.m
(where $MATLABROOT is the MATLAB root directory on your machine, as returned by typing
matlabroot
at the MATLAB Command Prompt.)
Rename the file to statchol.m.old
3. Download the attached file. Place the new file in the same directory mentioned in step 2.
4. Restart MATLAB
5. After restarting MATLAB, issue the following command at the MATLAB Command Prompt:
rehash toolboxcache