How can i get the fibonacci sequence ?
3 次查看(过去 30 天)
显示 更早的评论
回答(3 个)
Image Analyst
2014-3-17
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 个评论
Youssef Khmou
2014-3-17
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 个评论
另请参阅
类别
在 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!