### Translated by

이 페이지의 내용은 영어에서 자동 번역되었습니다. 자동 번역 기능을 해제하려면 "<a class="turn_off_mt" href="#">여기</a>"를 클릭하십시오.

## How to find rearrange these values in a new row and column?

### Mohammad Danial Bin Kamarul Zaman (view profile)

on 15 Feb 2019
Latest activity Commented on by Mohammad Danial Bin Kamarul Zaman

on 15 Feb 2019

### Star Strider (view profile)

For example: I have the following array of data.
column 1 column 2
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
I would like to make a new array of data sets with
column 1 column 2
2 3
4 5
5 6
8 9
What would be the best command to rearrange the matrix?

### Star Strider (view profile)

on 15 Feb 2019

One approach:
A = [1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9];
L = ismember(A(:,1), [2 4 5 8]);
B = A(L,:)
produces:
B =
2 3
4 5
5 6
8 9

on 15 Feb 2019

newmatrix = matrix([2 4 5 8],:)

### Mohammad Danial Bin Kamarul Zaman (view profile)

on 15 Feb 2019
Thank you soo much for your suggestion.
Unfortunately it doesn't work. Maybe its because the first data is not in terms of rows and columns.
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.
Below is the current code that I'm working on:
FrontFaceNodes=numData(:,1);
TotalNodes=numData(:,10);
Totalstress=numData(:,11);
Total_nodes_stress(:,1)=TotalNodes;
Total_nodes_stress(:,2)=Totalstress;
Max_stress=max(max(Total_nodes_stress(:,2)));
Ave_stress=mean(mean(Total_nodes_stress(:,2)));
Newmatrix=Total_nodes_stress([FrontFaceNodes(:,1)],:);

on 15 Feb 2019
Could you attach your file? and please explain what you want to do.