<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'*while* loop homework problem' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread '*while* loop homework problem' posted on the 'Matlab' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 14:01:08 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 14:01:08 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>*while* loop homework problem</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/409396/409396/while-loop-homework-problem/</link>
      <description>"One interesting property of a Fibonacci sequence is that the ratio of the values of adjacent members of the sequence approach a number called “the golden ratio” or PHI. Create a program that accepts the first two numbers of a Fibonacci sequence as a user input and then calculates additional values in the sequence until the ratio of adjacent values converges to within 0.001. You can do this in a WHILE loop by comparing the ratio of element k to element k-1 and the ratio of element k-1 to element k-2. If you call your sequence x, then the code for the WHILE statement is&lt;br /&gt;
&lt;br /&gt;
while abs(x(k)/x(k-1) – x(k-1)/x(k-2))&amp;gt;0.001"&lt;br /&gt;
&lt;br /&gt;
the first part of the code is:&lt;br /&gt;
x(1)=input('Enter the first starting value for your Fibonacci: ')&lt;br /&gt;
x(2)=input('Enter the second starting value for your Fibonacci: ')&lt;br /&gt;
&lt;br /&gt;
^^^but idk how to complete the rest with the WHILE loop&lt;br /&gt;
&lt;br /&gt;
i need to calculate how many terms [k] are needed to get an error within 0.001 units but im clueless...thanx in advance for any help guys&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/409396/409396/while-loop-homework-problem/</guid>
      <pubDate>Mon, 16 Nov 2009 14:22:33 -0700</pubDate>
      <category>Matlab</category>
    </item>
  </channel>
</rss>
