我是靠谱客的博主 能干乌冬面,最近开发中收集的这篇文章主要介绍matlab无限运行,[求助] 关于matlab无限循环的问题,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

各路大神,求助啊啊啊啊~

以下是我的代码:

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分钟不到吧。现在到底是个什么情况?跪求各位大神指点啊啊啊啊!

下面是楼主的截图:

4aa8017803792ad5d0f7fd7aee5beedb.png

最后

以上就是能干乌冬面为你收集整理的matlab无限运行,[求助] 关于matlab无限循环的问题的全部内容,希望文章能够帮你解决matlab无限运行,[求助] 关于matlab无限循环的问题所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(49)

评论列表共有 0 条评论

立即
投稿
返回
顶部