double_fibonacci takes two integers, each greater than one, as input arguments (it does not have to check the format of the input) and returns a two-dimensional array. If it is called likethis,
A = double_fibonacci(M,N), then A is an M-by-N array that has the Fibonacci series on its first row, has the same series in its first column, and for rows n = 2 to M , row n contains the Fibonacci numbers that begin with nth number in the series. Here is an example showing the output when the input integers are 6 and 9,
A = double_fibonacci(6,9):
A =
[1 1 2 3 5 8 13 21 34;
1 2 3 5 8 13 21 34 55;
2 3 5 8 13 21 34 55 89;
3 5 8 13 21 34 55 89 144;
5 8 13 21 34 55 89 144 233;
8 13 21 34 55 89 144 233 377]
The first row of A gives the first nine numbers in the Fibonacci series. The series
starts with two ones, and each subsequent number is equal to the sum of
the two numbers that precede it.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers31
Suggested Problems
-
Check to see if a Sudoku Puzzle is Solved
341 Solvers
-
Omit columns averages from a matrix
620 Solvers
-
Sum all integers from 1 to 2^n
18060 Solvers
-
109 Solvers
-
Number of Even Elements in Fibonacci Sequence
1690 Solvers
More from this Author2
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!