MATLAB GURU FETEX 2014 (Q.5 with Solution Codes)

Posted on at


Q.5 Fibonacci Series:

The Fibonacci series is computed according to the following relation:

Write a MATLAB code that compute the first n Fibonacci numbers where n is taken from user. For example, If n=6, your output vector should be [1 1 2 3 5 8 13].

Solution:

First Method:

 

 

Second Method:

 

Third Method:

Authored by : Shahid Ali Murtza

 

 



About the author

160