<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437</link>
    <title>MATLAB Central Newsreader - fibonacci numbers</title>
    <description>Feed for thread: fibonacci numbers</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 18 Nov 2008 18:32:02 -0500</pubDate>
      <title>fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611602</link>
      <author>Maria </author>
      <description>i have to write a function that generates the fibonacci sequence with out using loops. the length is specified by the user.if a single number is specified the sequence should be generated for numbers -Fn...Fn and if twoarguments ar given the sequence should run from Fm...Fn. and the zeroth term assume 0 is F0. Can anyone help me??</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 23:13:02 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611674</link>
      <author>Matt </author>
      <description>&quot;Maria &quot; &amp;lt;mariaki16@hotmail.com&amp;gt; wrote in message &amp;lt;gfv1n2$r4j$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; i have to write a function that generates the fibonacci sequence with out using loops. the length is specified by the user.if a single number is specified the sequence should be generated for numbers -Fn...Fn and if twoarguments ar given the sequence should run from Fm...Fn. and the zeroth term assume 0 is F0. Can anyone help me??&lt;br&gt;
&lt;br&gt;
Looks like there is a closed form expression for the sequence here. &lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Fibonacci_number#Power_series&quot;&gt;http://en.wikipedia.org/wiki/Fibonacci_number#Power_series&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
So can't you evaluate it directly?</description>
    </item>
    <item>
      <pubDate>Tue, 18 Nov 2008 23:43:02 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611678</link>
      <author>Maria </author>
      <description>no becouse we don't know the array.is given by the user.so i have to create a formula for a random array...the golden radio is recomented to do the formula(&lt;a href=&quot;http://www.mathworks.com/moler/intro.pdf)&quot;&gt;http://www.mathworks.com/moler/intro.pdf)&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 00:17:02 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611686</link>
      <author>Matt </author>
      <description>&quot;Maria &quot; &amp;lt;mariaki16@hotmail.com&amp;gt; wrote in message &amp;lt;gfvju6$8er$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; no becouse we don't know the array.is given by the user.so i have to create a formula for a random array...the golden radio is recomented to do the formula(&lt;a href=&quot;http://www.mathworks.com/moler/intro.pdf)&quot;&gt;http://www.mathworks.com/moler/intro.pdf)&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Sorry, I didn't understand that. What is &quot;the array&quot;?&lt;br&gt;
&lt;br&gt;
I thought the user inputs the value of n. Once you know n, you can evaluate Fn from the formula.</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 00:26:20 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611690</link>
      <author>Matt </author>
      <description>&quot;Matt&quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in message &amp;lt;gfvltu$qpd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Maria &quot; &amp;lt;mariaki16@hotmail.com&amp;gt; wrote in message &amp;lt;gfvju6$8er$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; no becouse we don't know the array.is given by the user.so i have to create a formula for a random array...the golden radio is recomented to do the formula(&lt;a href=&quot;http://www.mathworks.com/moler/intro.pdf)&quot;&gt;http://www.mathworks.com/moler/intro.pdf)&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sorry, I didn't understand that. What is &quot;the array&quot;?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I thought the user inputs the value of n. Once you know n, you can evaluate Fn from the formula.&lt;br&gt;
&lt;br&gt;
Just to be clear, this is the implementation I'm thinking of:&lt;br&gt;
&lt;br&gt;
g=(1+sqrt(5))/2;  %The golden ratio&lt;br&gt;
&lt;br&gt;
F=@(n) (g.^n- (1-g).^n)/sqrt(5);  %Formula for n-th Fibonacci number&lt;br&gt;
&lt;br&gt;
sequence= F(0:n); %Fibonacci sequence from 0 to n</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 00:38:02 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611693</link>
      <author>Maria </author>
      <description>yeah thats right but i've got a problem inputing a single number its have to outpout [-x:x]insteat of that i have this:&lt;br&gt;
&lt;br&gt;
&amp;gt;&amp;gt; fibonacci(4)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0     0     0     0     0     1     1     2     3&lt;br&gt;
&lt;br&gt;
for the 2 inputs is working right&lt;br&gt;
&amp;gt;&amp;gt; fibonacci(4,5)&lt;br&gt;
&lt;br&gt;
ans =&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3     5&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 00:48:02 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611694</link>
      <author>Matt </author>
      <description>&quot;Maria &quot; &amp;lt;mariaki16@hotmail.com&amp;gt; wrote in message &amp;lt;gfvn5a$edd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; yeah thats right but i've got a problem inputing a single number its have to outpout [-x:x]insteat of that i have this:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; fibonacci(4)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;      0     0     0     0     0     1     1     2     3&lt;br&gt;
&lt;br&gt;
OK. Well, the left hand tail of the sequence obeys the difference equation&lt;br&gt;
&lt;br&gt;
F(-k)=F(-k+2)-F(-k+1), k=0,1,...&lt;br&gt;
&lt;br&gt;
You must solve this difference equation with boundary conditions&lt;br&gt;
&lt;br&gt;
F(0)=0, F(1)=1&lt;br&gt;
&lt;br&gt;
to get that half of the sequence.</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 01:12:01 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611695</link>
      <author>Maria </author>
      <description>oh tnx !!!! great!!! is working;)</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 01:22:01 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611696</link>
      <author>Roger Stafford</author>
      <description>&quot;Matt&quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in message &amp;lt;gfvno1$mhd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; .........&lt;br&gt;
&amp;gt; OK. Well, the left hand tail of the sequence obeys the difference equation&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; F(-k)=F(-k+2)-F(-k+1), k=0,1,...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; You must solve this difference equation with boundary conditions&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; F(0)=0, F(1)=1&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; to get that half of the sequence.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Matt, I think you will find that the same Binet formula works for negative values of n, so the use of difference equations can be avoided altogether.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Wed, 19 Nov 2008 15:27:02 -0500</pubDate>
      <title>Re: fibonacci numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239437#611820</link>
      <author>Matt </author>
      <description>&quot;Roger Stafford&quot; &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in message &amp;lt;gfvpnp$6tp$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Matt&quot; &amp;lt;mjacobson.removethis@xorantech.com&amp;gt; wrote in message &amp;lt;gfvno1$mhd$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; .........&lt;br&gt;
&amp;gt; &amp;gt; OK. Well, the left hand tail of the sequence obeys the difference equation&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; F(-k)=F(-k+2)-F(-k+1), k=0,1,...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; You must solve this difference equation with boundary conditions&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; F(0)=0, F(1)=1&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; to get that half of the sequence.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   Matt, I think you will find that the same Binet formula works for negative values of n, so the use of difference equations can be avoided altogether.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
OK. Well, then I don't know what problem with negative n that Maria was refering to...</description>
    </item>
  </channel>
</rss>

