MATLAB: How to create a Matlab 10×10 matrix of numbers 1-100

matrix

How do I create a Matlab 10×10 matrix that contains the numbers 1-100 in column major form? I am not allowed to use the colon operator more than four times.

Best Answer

A=reshape(1:100,10,10)
or
A=reshape(1:100,10,10)'