matlab循环次数 inf,循环求解y值,出现Inf是因为数值过大,显示不出来吗?

matlab循环次数 inf,循环求解y值,出现Inf是因为数值过大,显示不出来吗?clear clc format long y 1 1 5 for i 1 100 y i 1 y i 0 5 y i 2 0 5 end y y 运行 matlab 结果 y 1 0e 159

大家好,我是讯享网,很高兴认识大家。

clear;

clc;

format long;

y(1)=1.5;

for i=1:100

y(i+1)=y(i)+0.5*(y(i)^2+0.5);

end

y=y'

运行matlab结果:

y =

1.0e+159 *

0.000000000000000

0.000000000000000

0.000000000000000

0.000000000000000

0.000000000000000

0.000000000000000

0.000000000000000

0.000000000000000

0.000000000000000

0.000000000000000

1.0035

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf


讯享网

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

Inf

小讯
上一篇 2025-03-06 14:04
下一篇 2025-01-24 17:49

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/40134.html