Get a tool to automatically generates your mex-files from standard C/Fortran codes
I also ecommend this math education website

Generate your mex file online (C/C++/FORTRAN)
  Automatic Online POSIX Thread (C/C++)


Using CPLEX with MATLAB

Claude Tadonki
Computer scientist

Note : This page provides matlab routines (with associated c mex-file) to run CPLEX features in a matlab environment. The initial routines (lp and qp) was done by David Musicant ( Carleton College ). Several extensions including the optimization options, error handling, and the adaptation to the Mixed Integer Programming was done by Claude Tadonki (University of Orsay - LAL/CNRS/IN2P3). You are allowed to download and use materials of this page freely for research purposes, provided you correctly mention the authors as described in each file. Here you can get code for lp, qp, and mip with CPLEX 6.5 and CPLEX 8.1. Upgrades to newer versions of CPLEX are now available (thanks to Travis Johnson)

Download all files as a single tar file

Download all files as a single tar file (NEWER VERSION OF CPLEX)

C Mex-Files should be compiled with the command

                       mex   -I/cplex_include_fullpath   -L/cplex_library_fullpath   -lcplex  file.c

Original file for Solving a standard linear programming problem

See here

 

General Linear Programming

[obj, x, lambda, status, colstat, it] = lp_cplex(c, A, b, l, u, le, ge, maxIter, optimizer)

min  c' * x   with linear constraints

optimizer is a variable for optimizer choice, which can be one of the following
0 : primal simplex
1 : dual simplex
2 : network
3 : primal - dual barrier

Download                                                     Matlab file             Associated mex file       Associated mex file (current version of cplex)

 

 

Quadratic Programming

[obj, x, lambda, status, colstat, it] = qp_cplex(q, c, A, b, l, u, le, ge, maxIter)

min 1/2 * x' * Q * x + c' * x  with linear contraints

Download                                                     Matlab file             Associated mex file       Associated mex file (current version of cplex)

 

 

Mixed Integer Programming

[obj, x, lambda, status, colstat, it] = mip_cplex(q, c, A, b, l, u, le, ge, binvar, genvar, maxIter, verbose)

min  c' * x   with linear contraints and integer variables ( binary or general )

Indices of binary variables are listed in binvar, and indices of general integer variables are listed in genvar

Download                                                     Matlab file             Associated mex file       Associated mex file (current version of cplex)

Get a tool to automatically generates your mex-files from standard C/Fortran codes
Get UNIVERSAL REPORT, a source codes documentation tool

site d'exercices en ligne plus de 15000 exercices en ligne Selected papers by the author: