Excel add in problem with INTLINPROG function

조회 수: 2 (최근 30일)
Bannour
Bannour 2020년 5월 28일
댓글: Bannour 2020년 6월 1일
Hi,
I compiled the SELECT_PROJ.m function with the library compiler for Excel. During the execution of the function, excel returned an error message (See screenshot "ExcelAddin_INTLINPROG.png").
The function works very well in the matlab environment.
You can try the "SELECT_PROJ" function with the following parameters:
p=binornd(1,0.7,1,50);
X1=randi([0 10],[5 50]);
X2=sum(p.*X1,2);
alpha=0.05;
-----------------------------------------------------------------------------------------------------
function y=SELECT_PROJ(X1,X2,alpha)
N=length(X1);
f = [];
intcon = 1:N;
Aeq=[];
beq=[];
A=[X1;-X1];
b=[(1+alpha)*X2;-(1-alpha)*X2];
lb = zeros(N,1);
ub = ones(N,1);
y = intlinprog(f,intcon,A,b,Aeq,beq,lb,ub);
  댓글 수: 2
Alan Weiss
Alan Weiss 2020년 6월 1일
That error in intlinprog has been made much less frequent in newer MATLAB versions. What version are you running?
Alan Weiss
MATLAB mathematical toolbox documentation
Bannour
Bannour 2020년 6월 1일
Hi,
I'm using 2017b version.
----------------------------------------------------------------------------------------------------
MATLAB Version: 9.3.0.713579 (R2017b)
MATLAB License Number: 1115960
Operating System: Microsoft Windows 10 Entreprise Version 10.0 (Build 15063)
Java Version: Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.3 (R2017b)
Curve Fitting Toolbox Version 3.5.6 (R2017b)
Database Toolbox Version 8.0 (R2017b)
MATLAB Compiler Version 6.5 (R2017b)
Optimization Toolbox Version 8.0 (R2017b)
Statistics and Machine Learning Toolbox Version 11.2 (R2017b)

댓글을 달려면 로그인하십시오.

답변 (1개)

Alan Weiss
Alan Weiss 2020년 6월 1일
Sorry, the major change I know about occurs in R2019a (see Functionality Being Removed or Changed). I don't know how to help you easily for your version. The error comes about from a stall in the solution process. This usually occurs "... from linear constraint matrices that have large condition number, or problems that have large solution components. To correct these issues, try to scale the coefficient matrices, eliminate redundant linear constraints, or give tighter bounds on the variables." (I am quoting the R2019a exitflag description for new exit flags that correspond to this error in your software version.)
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Bannour
Bannour 2020년 6월 1일
Hi Alain,
I do not think that the problem is due to the linear constraints or the coefficients of the matrices. the SELECT_PROJ.m function works well in the matlab environment. You can try it with the settings below. I think the result compiled with the 'Matlab Compiler' tool is causing a problem.
Thank you !

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by