could apm file key matrix??
if yes , how can i do matrix multiply
such as declare Q as a matrix (K*K)
b (K*1) vector
then do Q*x<b
and can do Q*(Qtranspose)

Please see the following link for additional information on MINLP including a MATLAB and Python interface to the Mixed Integer Nonlinear Programming solver, APOPT.
http://apmonitor.com/me575/index.php/Main/DiscreteOptimization

Amirhosein, there is an integer tolerance (possibly 1e-3). As long as the value is within that tolerance of an integer value, it is declared as an integer and accepted as a potential solution. Could you send me a copy of your files at john.hedengren@byu.edu if this isn't the issue?

I have 2 question.
1. I tried to use my own function with 15 binary variables. In the results, the last one has a real value between 0 to 1. Why?
2. It can find the optimum solution of my function by only 1 iteration. How is it possible? that is because I have no non-integer variable?
thanks

One last question, Where exactly I should put csv_load() command in minlp.m file that you provide in your submission? I think this is why I can't retrieve the data from csv file.
I am using minlp.m file that you submitted in this page.
Thanks for your help

Below is a simple model file that demonstrates how to load in external parameters into APMonitor. You can replace the File *.csv section with loading a CSV file of your choice through MATLAB with the csv_load() function. For testing, just copy the lines below and insert into the web-interface at: http://apmonitor.com/online/view_pass.php
Constants
m = 4
Parameters
c[1:m] = 1.2
Variables
intv ! integer variables start with "int"
Intermediates
! summation of all elements
s[0] = 0
s[1:m] = s[0:m-1] + c[1:m]
Equations
! v to be equal to the nearest integer for summation
minimize (s[m] - intv)^2
File *.csv
c[1], 2.3
c[2], 5.1
c[4], 0.0
End File

Comment only