Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Fibonacci function without using the fibonacci function (for loop)

1 Ansicht (letzte 30 Tage)
Charlotte Reed
Charlotte Reed am 19 Mär. 2020
Kommentiert: Rik am 19 Mär. 2020
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 Kommentar
Rik
Rik am 19 Mär. 2020
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)

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by