title: IBM ILOG CPLEX 12 with matlab, specify custom objective function
body: <p>I am very new to using IBM CPLEX , and am using CPLEX with Matlab. I was wondering how to compile a custom objective function in CPLEX using Matlab. The objective function is as follows: <img src="https://i.stack.imgur.com/rx6kE.png" alt="Optimization problem to replicate in CPLEX using MATLAB"></p>
  
  <p>Here aj is a column vector of size 36000 X 1 and A is a sparse matrix of size 36000 x 4503.   wj is a column vector of size 4503 x 1 of optimization variables. Until now this is a simple <code>cplexlsqnonneglin</code> if we include the wj >=0 constraint. But I would also like to include the two other sum terms with <code>'beta'</code> and <code>lambda</code> and the wjj = 0 constraint. Any help in recreating this optimization problem in CPLEX would be much appreciated.</p>
  
  <p>Thanks in advance!</p>