I would like to create a [m,n] size matrix in which the ID of the elements are created clockwise/counterclockwise.
The first element should starts in (1,1).
For example, for a matrix of size [5,8] (meaning 40 elements in total) we should have this final matrix:
This should be the result in Matlab:
Thank you in advance for your answers !