MATLAB Answers

sorting data in a nested cell

2 ビュー (過去 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.

  0 件のコメント

Sign in to comment.


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:
Change these algorithms to suit your application:

  1 件のコメント

madhan ravi
madhan ravi 2018 年 10 月 13 日
+1 vote @amin ya smooth crystal clear

Sign in to comment.

その他の回答 (0 件)

Translated by