Why does my function give no outputs?
조회 수: 10 (최근 30일)
이전 댓글 표시
function [A]=AccGold()
n = 4;
while Gold(n)-Gold(n-1) > 0.00000001
n = n+1;
A = Gold(n)
end
end
I want to find the first value of Gold(n)-Gold(n-1) such that it is < 0.0000001
댓글 수: 0
채택된 답변
Walter Roberson
2016년 1월 25일
편집: Walter Roberson
2016년 1월 25일
If the condition is immediately false you never assign to A.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!