Originally posted by: PingLiu
I run the enr.lp in command window
cplex>read enr.lp cplex>mipopt enr.lp cplex>write filename:enrsol filetype:sol
and also run the following code in matlab
cplex=Cplex(
'enr'); cplex.readModel(
'enr.lp'); cplex.solve(); x = cplex.Solution.x; fval= cplex.Solution.objval;
I have several questions after comparing the results.
from the enrsol.sol file, we can see the index of x is not the same as that of variables.
for example, x(3) is the value of variable 'x13', not 'x3'.
How can I get the index of variables in x matrix after running the code 'cplex.Solution.x' in matlab?
how can I write .sol file in class CPLEX through the interface of matlab?
why is the value of fval (145.4616) got in matlab different from the objective one(145.459503720117) got from cmd command?
thanks a lot.
#CPLEXOptimizers#DecisionOptimization