for loop continued fraction
10 次查看(过去 30 天)
显示 更早的评论
i want use for loop this problem
the problem is 

what do i do?
x(n)=1+1/x(n-1) ?
i'm in tutorial line, so please explain easy
2 个评论
Kevin Phung
2019-5-29
What exactly is happening in each iteration? The picture is a bit confusing.
are you trying to do 1 + (1/1+n)?
Star Strider
2019-5-29
Experiment with it to get the result you want.
回答(1 个)
James Tursa
2019-5-29
Yes, you can use the formula x(n) = 1 + 1/x(n-1) if you want to use a loop. Just start with x(1) = 1.
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!