Problem 42763. Fill the Matrix - 2
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 mean of the previous row. The matrix should be filled as follows.
input matrix = [1:8]' n = 4; output = [ 0 0 0 0 1 0.2 0 0 0 2 0.44 0.2 0 0 3 0.7280 0.44 0.2 0 4 1.0736 0.7280 0.44 0.2 5 1.4883 1.0736 0.7280 0.44 6 1.9460 1.4883 1.0736 0.7280 7 2.4472 1.9460 1.4883 1.0736 8 ];
I request you to use the mean( ) function.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers56
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3059 Solvers
-
292 Solvers
-
Implement a bubble sort technique and output the number of swaps required
380 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
397 Solvers
-
Matrix multiplication across rows
393 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!