CVX Installation Instruction
CVX is Matlab-based modelling language, primarily for constructing and solving convex optimization problems. (See http://cvxr.com/cvx/ for more details.) Although installing CVX is fairly straightforward, this page summarizes the key steps. If you come across any problems or issues, please see
Installing Matlab
Matlab is available for free for current students at MIT from IS&T. Please follow the installation instructions from IS&T that can be found [here | [http://web.mit.edu.ezproxyberklee.flo.org/student-matlab/]]. If you've never used MATLAB before, there are some beginner tutorials and other [info | [http://web.mit.edu.ezproxyberklee.flo.org/matlab/www/]].
Installing CVX
After installing Matlab and testing your installation, you are ready to install CVX. Follow the instructions available from CVX Research. Some notes:
- Mac users should use the "UNIX" files .tar.gz files.
- You only need to follow the sections labeled "Supported Platforms" and "Installation Instructions." The sections "Installing a CVX Professional License" and "Using CVX with Gurobi or MOSEK" are optional and not required for Software Tools Class . (See below for more details.)
- The instructions may suggest creating a "startup.m" file if you're on a UNIX system. (If you're on Windows, this may not happen.) This is a configuration file for MATLAB so that it will always know where to look for CVX functions. We also recommend adding one.
- Look in your "MATLAB" folder. It might be in a location like: "/Users/<your username>/Documents/MATLAB"
- If you already have a startup.m file, great! If not, create a blank document named startup.m in this location.
- Add the following code to your startup.m file
addpath <path to MATLAB folder>/MATLAB/cvx
addpath <path to MATLAB folder>/MATLAB/cvx/structures
addpath <path to MATLAB folder>/MATLAB/cvx/lib
addpath <path to MATLAB folder>/MATLAB/cvx/functions
addpath <path to MATLAB folder>/MATLAB/cvx/commands
addpath <path to MATLAB folder>/MATLAB/cvx/builtins
replacing < path to MATLAB folder > as appopriate.
Connecting CVX to Gurobi
Questions, Comments and Common Problems
If you come across an error in these installation instructions, please
- Email the session leader
- If you are certain about the correction, please edit this Wiki document appropriately. Remember to include all pertinent details including any OS or version info.
- If you are not certain about the correction, start a comment thread on this page to discuss.