Matrix 10x10 with same number in each row by column.
Show older comments
As title says I'm looking for a way to generate a matrix 10x10 where each row has same number as a number of a column. Like if we are on column 1 all rows are filled with 1's or for column 5 all rows are filled with 5's. I was trying to use function 'zeros()' to generate them and in 'for' loop gradually increase them. I hope to find more refined method to do this task.
Accepted Answer
More Answers (1)
M=repelem(1:10,10,1)
M = ceil( reshape(1:100,10,10) /10 )
M = fft(1:10,10,1)
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!