Given two input ,first one is CN (Column Number), Second one is Dim Can you produce such a matrix for example
CN=6; Dim=2
K = [1 1 0 0 0 0
0 0 1 1 0 0
0 0 0 0 1 1]CN=7; Dim=2
K =[ 1 1 0 0 0 0 0
0 0 1 1 0 0 0
0 0 0 0 1 1 0
1 0 0 0 0 0 1]
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers143
Suggested Problems
-
Arrange vector in ascending order
836 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
896 Solvers
-
Create an n-by-n null matrix and fill with ones certain positions
737 Solvers
-
Height of a right-angled triangle
2102 Solvers
-
Find my daddy long leg (No 's')
2854 Solvers
More from this Author21
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!