How can i get the fibonacci sequence ?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
by using for-loops or while-loops
0 comentarios
Respuestas (3)
Image Analyst
el 17 de Mzo. de 2014
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
0 comentarios
Youssef Khmou
el 17 de Mzo. de 2014
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
0 comentarios
Sohila Wagdi
el 22 de Sept. de 2020
function y=fibo(x) y(1)=1; y(2)=1; for n=3:x y(n)=y(n-1)+y(n-2); end
0 comentarios
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!