sorting data in a nested cell

조회 수: 1 (최근 30일)
Susan Santiago
Susan Santiago 2018년 10월 8일
댓글: madhan ravi 2018년 10월 13일
I have a cell C that looks like this
The cells in the first column are all some numberx14. I want to sort C in ascending order based on the values of the first column of data in the cells in the first column of cell C. How would I go about doing that? I'm getting very confused with indexing for cells like this and just want to rearrange the cell.

채택된 답변

amin ya
amin ya 2018년 10월 9일
편집: amin ya 2018년 10월 9일
You need to write a for loop and use classic sort algorithm. I had this problem, but there is no easy way to access or sort the data of matrixes inside the cell.
For example, you can access the first element of a matrix in the (1,1) element of the cell like this:
A{1,1}(1,1)
Change these algorithms to suit your application:
  댓글 수: 1
madhan ravi
madhan ravi 2018년 10월 13일
+1 vote @amin ya smooth crystal clear

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by