Question: A Fibonacci sequence is composed of elements created by adding the two previous elements. The simplest Fibonacci sequence starts with 1,1 and proceed s as

A Fibonacci sequence is composed of elements created by adding the two previous

elements. The simplest Fibonacci sequence starts with 1,1 and proceed

s as follows:

1, 1, 2, 3, 5, 8, 13, ...

However, a Fibonacci sequence can be created with any two starting numbers.

Create a MATLAB function that creates a Fibonacci sequence. There should be

three

inputs. The first and second number

of

the

desired

Fibona

cci sequence and the total

number of elements desired for the Fibonacci sequence.

For example, if you use your completed function to solve for the Fibonacci sequence

where the first two numbers are 3 & 4 and your total number of elements is 5, your

functi

on should return:

[3, 4, 7, 11, 18]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!