MATLAB: How to Create a 5×5 matrix whose rows are (1:5)

5x5matrixrows(1:5)

Create a 5×5 matrix whose rows are (1:5).

Best Answer

You can do that with simple vector multiplication:
A = ones(5, 1) * (1:5);
Related Question