Problem 52379. Double Fibonacci
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 commentsProblem Recent Solvers23
Suggested Problems
-
Remove all the words that end with "ain"
2176 Solvers
-
Numbers with prime factors 2, 3 and 5.
464 Solvers
-
Getting the indices from a matrix
625 Solvers
-
338 Solvers
-
Remove entire row and column in the matrix containing the input values
321 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!