フィルターのクリア

Sorting dataset, which contains strings, by one column

1 回表示 (過去 30 日間)
Sam
Sam 2016 年 3 月 18 日
コメント済み: Sam 2016 年 3 月 19 日
Hello,
I have a matrix of 1198x17. The first column is a column containing only strings. The first row contains 1 stringcell in cell 17, the rest of the first row are numbers. In cell A1 is a NaNvalue. All the other cells contain numbers. I need to sort this dataset by column #17 in such way that all the rows stay the same. How do I do this?
Thanks!

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 3 月 19 日
sortrows(A, 17)
  1 件のコメント
Sam
Sam 2016 年 3 月 19 日
The dataset is an excelfile. So if I use the code for xlsread, this isn't possible.
[num,txt,raw] = xlsread('dataset');
num contains only the number, txt only the stringcells, and raw contains everything. If I than use 'sort' or 'sortrows' for 'raw' Matlab gives an error...

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by