|
楼主 |
发表于 2006-5-4 19:36
|
显示全部楼层
回复:(simonphlk)新手提问,关于编程之后完全无反应...
- [t1,Ninput]=size(BBI);
- [t2,Noutput]=size(BBO);
- for i=1:Ninput
- switch BBI(1,i)
- case 1
- str1(i,:)='人数 ';
- case 2
- str1(i,:)='机构数 ';
- case 3
- str1(i,:)='固定资产净值 ';
- case 4
- str1(i,:)='营业支出 ';
- case 5
- str1(i,:)='ATM&POS ';
- case 6
- str1(i,:)=='所有者权益 ';
- end
- end
- for i=1:Noutput
- switch BBO(1,i)
- case 7
- str2(i,:)='净利息 ';
- case 8
- str2(i,:)='非利息 ';
- case 9
- str2(i,:)='营业收入 ';
- case 10
- str2(i,:)='存款 ';
- case 11
- str2(i,:)='贷款 ';
- case 12
- str2(i,:)='资本收益 ';
- case 13
- str2(i,:)='资产增加 ';
- case 14
- str2(i,:)='资产收益 ';
- case 15
- str2(i,:)='卡 ';
- case 16
- str2(i,:)='卡交易额 ';
- case 17
- str2(i,:)='不良下降率 ';
- case 21
- str2(i,:)='新增存贷款总额 ';
- end
- end
- sstrl=cellstr(str1)';
- sstr2=cellstr(str2)';
- sstrl=[cellstr('效率'),sstr1];
- sstr2=[cellstr('效率'),sstr2];
- sstr=[cellstr ('效率'),sstr1,sstr2];
- stl=char(sstrl);
- st2=char(sstr2);
- st=char(sstr);
- [ml,n]=size(st1);
- [m2,n]=size(st2);
- [m,n]=size(st);
- s1=deblank(stl(1,:));
- s2=deblank(st2(1,:));
- for i=2:m1
- len=30-2*length(deblank(st1(i,:)));
- front=round(len/2);
- back=30-front-2*length(deblank(stl(i,:)));
- s1=[s1,blanks(front),deblank(stl(i,:)),blanks(back)];
- end
- for i=2:m2
- len=30-2*length(deblank(st2(i,:)));
- front=round(len/2);
- back=30-front-2*length(deblank(st2(i,:)));
- s2=[s2,blanks(front),deblank(st2(i,:)), blanks(back)];
- end
- for i=1:m
- s(i,:)=[st(i,:) blanks(15)];
- end
- %B=BB
- BB=[BBI(2:t1,:),BBO(2:t1,:)];
- %B=BB
- B=[BB(1,:)/40;BB(2,:)/30;BB(3,:)/15;BB(4,:)/40;BB(5:t1-1,:)];
- %Ninput 投入数
- %Noutput 产出数
- %N 银行个数
- N=t1-1
- X=B(1:N,1:Ninput);
- Y=B(1:N,(Ninput+1):(Ninput+Noutput));
- e=0.00000001;
- ee=ones(1,(Ninput+Noutput));
- f=[zeros(1,N); -e*ee,1];
- XX=X';
- YY=Y';
- lbound=zeros((N+Ninput+Noutput),1);
- for i=1:N
- AA(:,:,i)=[XX,eye(Ninput),zeros(Ninput,Noutput),-XX(:,i);
- YY,zeros(Noutput,Ninput),-eye(Noutput),zeros(Noutput,1)];
- %ones(1,N),zeros(1,(Ninput+Noutput+1))]
- bb(:,i)=[zeros(1,Ninput),YY(:,i)']';
- % bb(:,i)=[zeros(1,Ninput),YY(:,i)',1]'
- options=optimset('largeScale','on','MaxIter',10^30,'TolFun',10^(-30));
- %[Xopt(:,i),fopt(i),exitflag(i)]=linprog(f,[],[],AA(:,:,i),bb(:,i),lbound,ub(:,i));
- [Xopt(:,i),fopt(i),exitflag(i),output(i)]=Iinprog(f,[],[],AA(:,:,i),bb(:,i),lbound);
- end
- Xopt;
- Thita=Xopt((N+1+Ninput+Noutput),:)';
- XXopt=[Xopt((N+1):(N+Ninput+Noutput),1)'*40;
- Xopt((N+1):(N+Ninput+Noutput),2)'*30;
- Xopt((N+1):(N+Ninput+Noutput),3)'*15;
- Xopt((N+1):(N+Ninput+Noutput),4)'*40;
- Xopt((N+1):(N+Ninput+Noutput),5:N)'];
- XXXopt=[Thita,XXopt];
- exitflag
- for i=1:N
- for j=1:Ninput
- R1(i,j)=((1-Xopt((I+Ninput+Noutput+N),i))*BB(i,j)+XXopt(i,j));
- R2(i,j)=((1-Xopt((1+Ninput+Noutput+N),i))*BB(i,j)+XXopt(i,j))/BB(i,j);
- end
- for k=1:Ninput
- R(i,2*k-1)=R1(i,k);
- R(i,k*2)=R2(i,k)* 100;
- end
- for j=1:Noutput
- I1(i,j)=XXopt(i,(Ninput+j));
- I2(i,j)=XXopt(i,(Ninput+j))/BB(i,j+Ninput);
- I(i,j)=I1(i,j);
- I(i,2*j)=I2(i,j);
- end
- for k=1:Noutput
- I(i,2*k-1)=Il(i,k);
- I(i,k*2)=I2(i,k)*100;
- end
- end
- RR=[Thita,R];
- II=[Thita,I];
- II(:,2)=round(II(:,2));
- [mi,ni]=size(II);
- [mr,nr]=size(RR);
- formatr='%4.2f';
- formats=[formatr,'%15.0f'];
- formats='%4.2f';
- s3=blanks(4);
- s4=blanks(4);
- for i=1:(nr-1)/2
- s3=[s3,blanks(9),'冗余量',blanks(9),'冗余率'];
- end
- for i=1:(ni-1)/2
- s4=[s4,blanks(9),'不足量',blanks(9),'不足率'];
- end
- for j=2:nr-1
- fomatr=[formatr,'%15.1f'];
- end
- formatr=[formatr,'\n'];
- for j=l:ni-1
- formati=[formati; '%15.1f'];
- end
- formats=[formati,'\n'];
- fid=fopen('001.DEA.approach.txt','w');
- fprintf(fid,'%s\n',s1);
- fprintf(fid,'%s\n',s3);
- fprintf(fid,formatr,RR');
- fprintf(fid,'\n');
- fprintf(fid,'%s\n',s2);
- fprintq(fid,'%s\n',s4);
- fprintf(fid,formati,II');
- fclose(fid);
复制代码 |
|