can someone write this out in matlab format so i can check that my homework answer was correct? Write a MATLAB program in a script file that determines and displays the first 20 Fibonacci numbers.
이전 댓글 표시
Write a MATLAB program in a script file that determines and displays the first 20 Fibonacci numbers.
댓글 수: 1
Yash
2013년 11월 21일
f = zeros(n,1);
f(1) = 1;
f(2) = 2;
for k = 3:n
f(k) = f(k-1) + f(k-2);
end
답변 (1개)
Image Analyst
2013년 11월 18일
0 개 추천
You can look up the first 20 Fibonacci numbers anywhere to check your answer. If your code produces them, it works. Why do you need us for that?
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!