If you know a function which is used to create a matrix, you can solve this problem easily !
I thought you referred to the function blkdiag(), but I am surprised to know that it is not the case (for a one-liner)!
17580 Solvers
Project Euler: Problem 10, Sum of Primes
725 Solvers
Make a run-length companion vector
521 Solvers
ZigZag matrix with reflected format
100 Solvers
Count consecutive 0's in between values of 1
172 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!