Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Cplex.addQCs Error: a has incompatible dimensions ... but it's just the example from the documentation

  • 1.  Cplex.addQCs Error: a has incompatible dimensions ... but it's just the example from the documentation

    Posted 10/29/14 04:23 AM

    Originally posted by: TF87


    Hello.

     

    I want to build a QP. I've read the documentation for cplex.addQCs

    http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.0/ilog.odms.cplex.help/refmatlabcplex/html/classCplex.html%23a21779992067abbd5fceb8df298322e51?lang=de

     

    but when I use the given example

    cplex.addQCs([0 0 0]',[1 0 0;0 1 0;0 0 1],'L',1,{'qc1'});
    

     

    I get the following error

    Error using Cplex/addQCs (line 3378)
    Cplex.addQCs Error: a has incompatible dimensions.
    Error in Cplex/subsref (line 3852)

     

    Do you know what is wrong, since it is just the example from the documentation?

    I'm using MATLAB R2014a & CPLEX Studio 12.5

     

    Thanks in advance.

     

    Best regards.

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex.addQCs Error: a has incompatible dimensions ... but it's just the example from the documentation

    Posted 10/29/14 06:33 AM

    Originally posted by: RWunderling


    Please verify that the dimensions of a and Q match the number of variables in your model.

    Roland


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex.addQCs Error: a has incompatible dimensions ... but it's just the example from the documentation

    Posted 10/29/14 06:56 AM

    Originally posted by: TF87


    Okay, the order is crucial. The addQCs method must be used at the end of constructing my model.

     

    Now it works, thank your very much.


    #CPLEXOptimizers
    #DecisionOptimization