Problem 42761. Fill the matrix - 1
Input is a column vector and n.
n columns will be added to the left of the input column. The first value of the row is the sum of the previous row. The matrix will be filled as follow;
input matrix = [1:8]' n = 4;
output = [ 0 0 0 0 1 1 0 0 0 2 3 1 0 0 3 7 3 1 0 4 15 7 3 1 5 31 15 7 3 6 62 31 15 7 7 122 62 31 15 8 ];
I request you to use sum( ) function.
Solution Stats
Problem Comments
-
1 Comment
Mehmet OZC
on 8 Mar 2016
Is it possible to write a recursive function for this problem?
Solution Comments
Show commentsProblem Recent Solvers60
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6471 Solvers
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
1977 Solvers
-
Multiples of a Number in a Given Range
780 Solvers
-
Convert a Cell Array into an Array
2001 Solvers
-
Mersenne Primes vs. All Primes
729 Solvers
More from this Author92
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!