what is wrong with this code
5 次查看(过去 30 天)
显示 更早的评论
clc; clear variables;
x(1)=0;
tic
for i=1:500
x(i+1)=(x(i).^2)*0.5+4;
if abs((x(i+1)-x(i)))<=0.00000001
break
else
x(i)=x(i+1);
end
end
toc
0 个评论
采纳的回答
Hiro Yoshino
2020-1-16
if abs((x(i+1)-x(i)))<=0.00000001
This condition is less likely to be met ... I think.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!