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 Solvers28
Suggested Problems
-
given 3 sides, find area of this triangle
820 Solvers
-
10714 Solvers
-
Convert a vector into a number
615 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
683 Solvers
-
661 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!