I am using the IBM ilog cplex optimizer to solve a large integer programming problem. I have to depend on MATLAB for generating the data set and I could copy it in the .dat file in the appropriate format. With this .dat file, I could solve the problem in the IBM ilog cplex environment. Next, I am trying to write the solved values in a .txt or a .m file so that I can import these values in MATLAB and use them for graphical representation. However, when I'm trying to do this, if the variable is too long, then it is being written in multiple lines as follows:
x_b = [0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 0];
Therefore, it is becoming impossible to import this as an array in MATLAB. So, could anyone please suggest a better method to do this?
Thanks.
In OPL CPLEX if you write .mod
and use your .dat
You will get exp.txt
that you can read with fscanf from Matlab