필터 지우기
필터 지우기

sorting a matrix column with the corresponding row

조회 수: 4 (최근 30일)
neamah al-naffakh
neamah al-naffakh 2017년 1월 22일
댓글: Star Strider 2017년 2월 5일
I have a matrix that contains ( 6 rows, 2 columns) as shown in the attached image.
I'd like to have a new matrix (in MATLAB) that contains the second columns arranged in ascending order, but would like to keep their corresponding values in the in the row. for example: the output matrix looks like this

채택된 답변

Star Strider
Star Strider 2017년 1월 22일
Use the sortrows function:
A = [1 1; 3 8; 5 9; 6 3; 7 24; 8 8];
B = sortrows(A, 2)
B =
1 1
6 3
3 8
8 8
5 9
7 24
  댓글 수: 4
neamah al-naffakh
neamah al-naffakh 2017년 2월 5일
편집: neamah al-naffakh 2017년 2월 5일
Dear Stat, do you have an idea about this topic please?
https://uk.mathworks.com/matlabcentral/answers/323450-training-neural-network-for-classification
Star Strider
Star Strider 2017년 2월 5일
Neural networks are not currently an area of my expertise. I studied them extensively many years ago, and used the first few releases of the Neural Network Toolbox, but I have not used them recently.
First see the documentation for Getting Started with Neural Network Toolbox. Then see the documentation for Classify Patterns with a Neural Network. Those should get you started.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parallel and Cloud에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by