Question: Problem 3. (25 points total). In Matlab Create a function file called fibonacci.m that when sent an integer (n) it returns a vector (fib). The

Problem 3. (25 points total). In Matlab

Create a function file called fibonacci.m that when sent an integer (n) it returns a vector (fib). The vector fib contains the first n elements of the fibonnacci sequence. Note that the first two numbers of the Fibonacci sequence are 1 and 1, but then every number after is just the sum of the previous two numbers. So 1+1 =2 and then 1+2 =3 and 2+3 =5 and 5+3=8 and so forth. So a Fibonacci sequence looks like: fib= [1 1 2 3 5 8 13 21 34 55 89.] In the command window (see below), call your function file in a single command that creates a vector f which is the first 30 elements of the Fibonacci sequence

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!