MATLAB: How to Rearrange a Matrix

elementsfeaMATLABmatrixnew matrixnodesrearrangestressvon mises stress

I have a matrix that I would like to rearrange into a new matrix.
Below is a simplified problem that I'm experiencing:
Matrix 1:
Column 1(Elements) Column 2 (Stress)
1 3.023
2 43.48
3 4956
4 45687
5 135
6 444
7 7916
8 646
9 6468
10 777
11 6548
12 4979
New Matrix:
Column 1(Elements) Column 2 (Stress)
2 43.48
4 45687
6 444
7 7916
8 646
12 4979
admittedly, I feel a bit stuck about this. Rather than continuing, Iā€™m wondering if I could lean on your expertise and insights to learn how to do it.
Thank you šŸ™‚

Best Answer

% let M be your matrix of two columns
ind = [2 4 6 7 8 12]; % desired indices
new_M = M(ind,:)