|
楼主 |
发表于 2009-6-7 10:37
|
显示全部楼层
晕,好像不行啊,报错
??? Maximum variable size allowed by the program is exceeded.
Error in ==> repmat at 60
B = A(ones(siz(1), 1), :);
Error in ==> vehicle3 at 24
X=repmat(xp,[nb,1])+repmat([1:nb]',[1,n]);
以下是我的全部程序
clear
clc
fid=fopen('nu.bin','r');
n=fread(fid,inf,'int32');
status=fclose(fid);
fid1=fopen('distance.bin','r');
D=round(10*fread(fid1,inf,'single'))/10;
status=fclose(fid1);
fid2=fopen('weight.bin','r');
W=fread(fid2,inf,'uint32');
status=fclose(fid2);
xp(1)=0;
for i=1:n-1
xp(i+1)=-D(i)+xp(i);
end;
lb=15.50; %梁长度
ne=155; %梁划分的单元数(太小不行)
deltl=lb/ne;
d=lb-xp(n);
nb=int32(d/deltl);
I=zeros(1,nb);
xp=int32(xp*10);
n=length(xp);
X=repmat(xp,[nb,1])+repmat([1:nb]',[1,n]);
SumX=sum((X==0)')+sum((X==77)')+sum((X==155)');
id=find(SumX);
xp=0*xp;
M=int32(zeros(1,length(id)));
i=1:n-1
xp(i+1)=-D(i)+xp(i);
for i=1:length(id)
XP=xp+id(i)*deltl;
k=1:n
M(i)=int32(W(k)*YXX(XP(k))+M(i));
end;
% M(:,M(1,:)==0)=[];
fid3=fopen('M.bin','w');
count=fwrite(fid3,M,'int32');
status=fclose(fid3);
fid4=fopen('nb.bin','w');
count=fwrite(fid4,nb,'uint64');
status=fclose(fid4);
fid5=fopen('M.txt','w');
fprintf(fid5,'%6.1f\n',M);
status=fclose(fid5); |
-
变量数
|