for example, if m=2, n=3 then the matrix become [1 2,3 4,5,6]' if m=4 n=4 it is [1 2 3 4,5 6 7 8,9 10 11 12,13 14 15 16]' I know I should use loop, but where should I start it? i think i may need some help here…it asks one output and two inputs.
MATLAB: How to create a function of matrix with integer(from 1 to infinite) that can be arranged by row and column
functionloopmatrixrow
Related Question
- Help with vectorizing Diag command
- This question is about making a square matrix of order n x n in which the integers from 1 to ? 2 wind back and forth along the rows. If n=3 then [1,2,3;6,5,4;7;8;9]
- How to equate a character to an integer
- Reshape – columnwise. any command to linewise
- Centroid value is in float instead of integer
Best Answer