How to Rearrange a Matrix
1 次查看(过去 30 天)
显示 更早的评论
Mohammad Danial Bin Kamarul Zaman
2019-2-15
评论: Mohammad Danial Bin Kamarul Zaman
2019-2-15
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 :)
2 个评论
Stephen23
2019-2-15
@Mohammad Danial Bin Kamarul Zaman: what is the algorithm/rule/relationship that maps matrix 1 to matrix 2?
采纳的回答
Kevin Phung
2019-2-15
编辑:Kevin Phung
2019-2-15
% let M be your matrix of two columns
ind = [2 4 6 7 8 12]; % desired indices
new_M = M(ind,:)
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stress and Strain 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!