필터 지우기
필터 지우기

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