super efficiency dea error: Index exceeds matrix dimensions

X=[];%input matrix
Y=[];%output matrix
n=size(X',1);
m=size(X,1);
s=size(Y,1);
epsilon=10^-10;
f=[zeros(1,n) -epsilon*ones(1,m+s) 1];
A=zeros(1,n+m+s+1);
b=0;
LB=zeros(n+m+s+1,1);
UB=[];
LB(n+m+s+1)=-Inf;
for i=1:n
Aeq=[[X(:,1:i-1),zeros(m,1),X(:,i+1:n)] eye(m) zeros(m,s) -X(:,i) [Y(:,1:i-1),zeros(s,1),Y(:,i+1:n)] zeros(s,m) -eye(s) zeros(s,1)]
beq=[zeros(m,1) Y(:,i)];
w(:,i)=linprog(f,A,b,Aeq,beq,LB,UB);
end
w
lambda=w(1:n,:);
s_minus=w(n+1:n+m,:);
s_plus=w(n+m+1:n+m+s,:);
theta=w(n+m+s+1,:);
I'm using the code above to solve a se-dea model with 38 DMUs, 11 input and 1 output. The code was found in a paper but it reports "Index exceeds matrix dimensions". I'm wondering why this happens and how to solve it. Thanks very much.

답변 (1개)

Hiro Yoshino
Hiro Yoshino 2019년 12월 2일
X=[];%input matrix
Y=[];%output matrix
Obviously the input dimensions for X, Y are zero, and thus
n=size(X',1);
m=size(X,1);
s=size(Y,1);
become zero. Am I taking it correctly?
why not using "break points" so you can check the line to know to what extent your code is OK?
This way you can check the code literally line by line.

댓글 수: 1

Sorry but I was using
X=[];%input matrix
Y=[];%output matrix
simply because the X matrix is 11×38 and Y is 1×38 so I omit them to control the text length. I think the error occurs in the following line
for i=1:n
Aeq=[[X(:,1:i-1),zeros(m,1),X(:,i+1:n)] eye(m) zeros(m,s) -X(:,i) [Y(:,1:i-1),zeros(s,1),Y(:,i+1:n)] zeros(s,m) -eye(s) zeros(s,1)]
beq=[zeros(m,1) Y(:,i)];
w(:,i)=linprog(f,A,b,Aeq,beq,LB,UB);
end
as I checked the code by line

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

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

질문:

2019년 12월 2일

댓글:

2019년 12월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by