필터 지우기
필터 지우기

How do I calculate the values of the fibonacci sequence using a while loop in matlab?

조회 수: 1 (최근 30일)
I am given the vector fib=[0,1]. I am told to create a new vector that continues the list of Fibonacci sequence values after the given vector using a while loop. The limit is 5702887. I am also given that there should be 26-39 elements in the new vector. My last step is to output the number of elements in the vector and their corresponding values. I am a beginner at matlab and am unfamiliar with while loops. Could someone please help me?
  댓글 수: 1
Torsten
Torsten 2015년 11월 26일
If you are not familiar with while-loops, try a for-loop together with an if-statement first. We will then help you to transform your code to include a while loop.
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 26일
You have also already had multiple copies of this questions closed as duplicates.
You need to stop re-posting your question and start using what you learned in the answers you have already been given. If there is something in those answers you do not understand, ask there. Do no keep reposting the same question.
When you continue to post the same question after having been given answers on the techniques to use, it makes it look like what you are asking is for someone to give you the solution to your homework.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by