该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
各路大神,求助啊啊啊啊~
以下是我的代码:
n=0
for i=1:length(NAXLES)
if CODE(i)==0
n=n+1
GVM1(n)=GVM(i)
GC(n)=(A2_MASS(i)* A1_SPACE(i)+ A3_MASS(i)* A2_SPACE(i) + A4_MASS(i)* A3_SPACE(i) + A5_MASS(i)* A4_SPACE(i) + A6_MASS(i)* A5_SPACE(i) + A7_MASS(i)* A6_SPACE(i) + A8_MASS(i)* A7_SPACE(i) + A9_MASS(i)* A8_SPACE(i) + A10_MASS(i)* A9_SPACE(i))/( A1_MASS(i)+A2_MASS(i)+A3_MASS(i) +A4_MASS(i) +A5_MASS(i) +A6_MASS(i) +A7_MASS(i) +A8_MASS(i) +A9_MASS(i) +A10_MASS(i))
X(n)= abs(A1_MASS(i)* GC(n)) + abs(A2_MASS(i)* (GC(n)- A1_SPACE(i))) + abs(A3_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i))) + abs(A4_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i))) + abs(A5_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)-A3_SPACE(i) - A4_SPACE(i))) + abs(A6_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i))) + abs(A7_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i))) + abs(A8_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i)- A7_SPACE(i))) + abs(A9_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i)- A7_SPACE(i)- A8_SPACE(i))) + abs(A10_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i)- A7_SPACE(i)- A8_SPACE(i)- A9_SPACE(i)))
Y(n)= A1_MASS(i)* GC(n) + A2_MASS(i)* (GC(n)- A1_SPACE(i)) + A3_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)) + A4_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i)) + A5_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)-A3_SPACE(i) - A4_SPACE(i)) + A6_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)) + A7_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i)) + A8_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i)- A7_SPACE(i)) + A9_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i)- A7_SPACE(i)- A8_SPACE(i)) + A10_MASS(i)* (GC(n)- A1_SPACE(i)- A2_SPACE(i)- A3_SPACE(i) - A4_SPACE(i)- A5_SPACE(i)- A6_SPACE(i)- A7_SPACE(i)- A8_SPACE(i)- A9_SPACE(i))
TL(n)= A1_SPACE(i)+ A2_SPACE(i)+ A3_SPACE(i) + A4_SPACE(i)+ A5_SPACE(i)+ A6_SPACE(i)+ A7_SPACE(i)+ A8_SPACE(i)+ A9_SPACE(i)
Bm(n)=4/GVM(i)*X(n)-2*(NAXLES(i)-1)/( NAXLES(i)* GVM(i)* GVM(i)* TL(n))*Y(n)* Y(n)
end
end
p=polyfit(Bm,GVM1,2)
xx=linspace(min(Bm),max(Bm))
yy=polyval(p,xx)
plot(Bm,GVM1,'k+',xx,yy,'r')
做的是一个数据的计算并且对结果进行二次拟合,可是,我的电脑已经跑了一天了,还没有处理完所有的数据,楼主截图后发现,电脑内部处理的数据在前10万个数据内循环,就是不能继续读后面的数据。此代码楼主先用前100个数据试了一下,没有问题才开始跑的,但是数据一多就不对了。
楼主需要处理的数据同工有1亿多组,是数据溢出吗?可是楼主有用同样的数据源跑其他的代码,没有问题,而且结果出的特别快,大概1分钟不到吧。现在到底是个什么情况?跪求各位大神指点啊啊啊啊!
下面是楼主的截图: