MATLAB: Select certain matrix elements MATLABmatrix index hello,everyone i just want to ask how to select eg the 1-10 and 20-30 rows elements in the first column. like A(1:10 and 20:30,1) Best Answer You can simply concatenate your ranges using square brackets:A([1:10 20:30],1) Related SolutionsMATLAB: Substraction with sum / loop I assume that the FOR loop is not essential.Result = A - cumsum(B, 1); % Matlab 2016b autoexpandingFor older Matlab versions:Result = bsxfun(@minus, A, cumsum(B, 1)); MATLAB: How can i reshape a matrix into a vector reshape(flipud(A).',[],1) Related QuestionSelecting certain rowsHow to get the maximum of repetitive elements in certain portions of a matrixHow to select certain elements from a matrixI have a 20×1 vertical matrix. I want to take the averages of the pairs in order and display them in another matrix. HowSelect elements of MatrixIf I have a matrix of data and I want to pull out certain data cells and arrange them in another matrixSelecting certain rows in an array
Best Answer