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
Solution Comments
Show comments
Loading...
Problem Recent Solvers63
Suggested Problems
-
27576 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
884 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1260 Solvers
-
17608 Solvers
-
5765 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!
Is it possible to write a recursive function for this problem?