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 Solvers30
Suggested Problems
-
116196 Solvers
-
Swap the first and last columns
23027 Solvers
-
Given two arrays, find the maximum overlap
1801 Solvers
-
Combinations without using nchoosek
140 Solvers
-
742 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!