MATLAB: Assigning count values to the column of a matrix matrix Hello, I have a matrix A with the size 29×3 and I want to fill third column with the numbers from 29(the max lenght) to 1. Is there a possible way to do it without using loops? Regards Best Answer Either one of these, depending on the order that you want:A(:,3) = 1:29A(:,3) = 29:-1:1 Related SolutionsMATLAB: Maximum of a row in a matrix Use max, and some indexing if needed:A = [...]; % some matrixN = 3; % the row that you wantmax(A(N,:)) MATLAB: Count G = randi(3, 45, 2);I = randi(3, 45, 2);sum(all(G == I, 2)) Related QuestionMatrix manipulation with vectorsFinding distinct values in a column of a matrixCount number of values within a range in matrix per column and assign count to new matrix
Best Answer