what is wrong with this code
조회 수: 1 (최근 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!