How to Rearrange a Matrix

조회 수: 1 (최근 30일)
Mohammad Danial Bin Kamarul Zaman
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
Stephen23 2019년 2월 15일
@Mohammad Danial Bin Kamarul Zaman: what is the algorithm/rule/relationship that maps matrix 1 to matrix 2?
Mohammad Danial Bin Kamarul Zaman
yes sir. I do but I'm super grateful I managed to sort it out :). Thank you

댓글을 달려면 로그인하십시오.

채택된 답변

Kevin Phung
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
Kevin Phung
Kevin Phung 2019년 2월 15일
youre welcome!
Mohammad Danial Bin Kamarul Zaman
If you don't mind, I really appreciate it if you could have a look at another problem that I've encountered. Please follow the link below as attached:
https://uk.mathworks.com/matlabcentral/answers/445222-how-do-i-make-a-code-that-store-large-amount-of-information-from-excel-into-a-matrix
My apologies, i'm still new to MATLAB and eager to learn more about it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Stress and Strain에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by