Need help running D-optimal example on cvx website

Hi everyone,

I hope this message finds you well. I am currently trying to run the D-optimal example provided on the cvx website at the following link: http://web.cvxr.com/cvx/examples/cvxbook/Ch07_statistical_estim/expdesign.m

However, I am encountering an issue when running the code, and I could use some assistance in resolving it. The error message I am receiving is as follows:

Error in cvx/sparsify>replcols (line 142)
    cvx___.readonly( ndxs ) = vec( cvx_readlevel( bN ) );

Error in cvx/sparsify (line 105)
    [ x, forms, repls ] = replcols( x, tt, 'none', forms, repls, isobj );

Error in cvx_end (line 212)
            x = sparsify( x, 'objective' );

Error in cvx/det_rootn (line 32)
    cvx_end

Error in log_det (line 28)
cvx_optval = size(X,1)*log(det_rootn(X));

Error in cvx_boyd (line 30)
  maximize ( log_det( V*diag(lambda)*V' ) ).

I would be extremely grateful if someone could kindly guide me on how to fix this issue and successfully run the code. Your support and expertise are highly valued.

Thank you very much in advance for your help!

It runs successfully for me. Perhaps your MATLAB session or CVX got corrupted or there is a problem with your CVX installation. Do any CVX programs runs successfully?

What is the output of cvx_version ? Make sure you are using CVX 2.2, not CVX 3.0beta, which is riddled with bugs.

Things to try:
New MATLAB session.

Reinstall CVX 2.2, in a new MATLAB session, after removing all CVX directories from tthe MATLAB path.

Reboot computer.

Thank you Mark for the response. I installed a new Matlab version as well as CVX 2.2. It perfectly woks now.

Thanks.