How to select a submatrix (not in any particular pattern) in Matlab
问题 How to select a submatrix (not in any pattern) in Matlab? For example, for a matrix of size 10 by 10, how to select the submatrix consisting of intersection of the 1st 2nd and 9th rows and the 4th and 6th columns? Thanks for any helpful answers! 回答1: TLDR: Short Answer As for your question, suppose you have an arbitrary 10-by-10 matrix A . The simplest way to extract the desired sub-matrix would be with an index vector: B = A([1 2 9], [4 6]); Indexing in MATLAB There's an interesting article