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 SolutionsMATLAB: How to solve a 5×5 matrix in Matlab A\b MATLAB: All Possible Combinations of 2 vectors >> [A,B,C,D,E] = ndgrid(1:5);>> M = [A(:),B(:),C(:),D(:),E(:)];M = 1 1 1 1 1 2 1 1 1 1 3 1 1 1 1 4 1 1 1 1 5 1 1 1 1 1 2 1 1 1 2 2 1 1 1 3 2 1 1 1... lots of lines here 2 4 5 5 5 3 4 5 5 5 4 4 5 5 5 5 4 5 5 5 1 5 5 5 5 2 5 5 5 5 3 5 5 5 5 4 5 5 5 5 5 5 5 5 5 Related QuestionRemoving columns from a 5×5 matrizHow to use elements i, j to print a 5×5 matrix
Best Answer