How can i get the fibonacci sequence ?

Antworten (3)

Image Analyst
Image Analyst am 17 Mär. 2014

0 Stimmen

Most likely John D'Errico has the best way for doing this. Look at his File Exchange submission and see how he does it. http://www.mathworks.com/matlabcentral/fileexchange/34766-the-fibonacci-sequence
Youssef  Khmou
Youssef Khmou am 17 Mär. 2014

0 Stimmen

hi, its easy to implement such function :
function y=fibo(x)
y(1)=1;
y(2)=1;
for n=3:x
y(n)=y(n-1)+y(n-2);
end
Sohila Wagdi
Sohila Wagdi am 22 Sep. 2020

0 Stimmen

function y=fibo(x) y(1)=1; y(2)=1; for n=3:x y(n)=y(n-1)+y(n-2); end

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 17 Mär. 2014

Beantwortet:

am 22 Sep. 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by