作者bear32147 (dogbear)
看板MATLAB
标题[问题] 写入cell矩阵、排序问题
时间Tue Oct 2 00:08:08 2012
各位好 遇到有两个问题
Q1
list_L1 为10*1 cell 矩阵
'and'
'for'
'in'
'it'
'reuter'
'said'
'the'
'to'
'a'
'of'
times_L1 为10*1 矩阵
72
54
65
57
100
79
81
70
71
75
目标是 想将list_L1矩阵以times_L1大小 排序
想到两种方法 都遇到问题
1.将 list_L1、 times_L1 合并用 sortrows排序
raw_data={list_L1 L_matrix1}; %这样会变成 双层cell矩阵
是否只能以回圈方式存入??
2. 先将 L_matrix1 排序 存出位置 再利用位置将list_L1 排序
[X Y]=sort(L_matrix1,'descend')
不知道 怎麽用Y将list_L1 排序
有点急
谢谢 各位
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.190.65
1F:推 rayko0702:[sorted index]=sort(times_L1) 10/03 23:58
2F:→ rayko0702:list_L1(index) 10/03 23:59
3F:→ rayko0702:两行解决 不知道是不是你要的 10/03 23:59