MATLAB: Special selecting rows of a matrix mathematicsmatlab functionmatricesmatrixmatrix manipulation Hi. I have a matrix of size m*n. I want to select those rows of this matrix that their value in 10th column are between 10 to 12. How can I do that? Thanks a lot. Best Answer Let M be the given matrix. Then do this:p = (1:size(M,1)).';p = p(M(:,10)<=12&M(:,10)>=10);p will be a column vector consisting of the row indices of all rows in M in which the element of the 10th column lies between 10 and 12. Related SolutionsMATLAB: Repeat last row at the end of matrix B = [A; A(end,:)] ; MATLAB: Special sorting Do not use "input" as name of a variable, because it is a name of a built-in function.in = [2, 2, 5, 6, 6, 6, 1, 1, 1, 1, 4, 3, 3];out = cumsum([1, diff(a) ~= 0]);>> out = [1 1, 2, 3, 3, 3, 4, 4, 4, 4, 5, 6, 6] Related QuestionLarge special matrixSelecting random number from martrixSpecial legend for special bar plotSelecting the last 60 rows in a matrix with an uncertain number of rowsCreating a special matrix
Best Answer