フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Fibonacci function without using the fibonacci function (for loop)

1 回表示 (過去 30 日間)
Charlotte Reed
Charlotte Reed 2020 年 3 月 19 日
コメント済み: Rik 2020 年 3 月 19 日
I am doing pracite questions and stuck on this one:
Write a MATLAB program that creates and outputs the first 30 numbers in the Fibonacci series. In your code, explicitly assign the first two numbers in the series, then built up the rest of series using a for-loop. Do not use MATLAB's fibonacci function. Output the 30 numbers, 5 numbers per line over 6 lines. Use an 8-character field width for each number. One final thing. Create all the output using a single fprintf statement that executes just once.
I am new to MATLAB and this function, and could really use some help on figuring out how to go about this!
  1 件のコメント
Rik
Rik 2020 年 3 月 19 日
Just like your other questions: go at it step by step. Did you manage to write code that will generate the Fibonacci sequence? How can you use fprintf to print a vector? (hint: you should be using a vector to store the sequence)

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by