排序字母数字数据,然后按数字分组-这是可能的吗?

2个视图(过去30天)
mel1708
mel1708 2020年3月10日
回答: Stephen Cobeldick 2020年3月10日
我有一些这样的数据。
0.0382705 -0.0389825 1.00923 48.8284 0.026284 2212 1 0 263 MyCulture/Cell316
0.00632027 0.0292156 1.00843 49.0162 0.0135636 2212 1 0 336 MyCulture/Cell550
0.00631382 0.0292307 1.00748 49.0026 0.0265101 2212 10 336 MyCulture/Nucleus0
0.00630899 0.0292418 1.00676 48.9761 0.0176806 2212 1 0 336 Myculture / Cell550
-0.0519997 -0.020363 0.907123 47.1952 0.0358084 2212 1 0 339 MyCulture/Cell706
MyCulture/Cell814 1 0 342 MyCulture/Cell814
0.0115323 0.023491 1.02113 50.0001 0.0126079 2212 1 0 441 MyCulture/Cell892
0.011535 0.0235026 1.02025 49.9875 0.0152807 2212 1 0 441 MyCulture/Nucleus0
0.0115374 0.0235152 1.01932 49.9722 0.0122807 2212 1 0 441 MyCulture/Cell892
0.0115877 -0.0191628 0.969385 48.0882 0.0364256 2212 1 0 528 MyCulture/Cell111
0.00670006 0.0449431 0.977987 48.8919 0.0218619 2212 1 0 537 MyCulture/Cell656
0.00649405 -0.0143382 0.991241 49.3342 0.0244002 2212 1 0 618 MyCulture/Cell555
0.00817589 -0.00516809 0.91224 47.0531 0.0266742 2212 1 0 700 MyCulture/Cell454
0.00819834 -0.00515017 0.911266 47.0264 0.00887502 2212 1 0 700 MyCulture/Nucleus0
0.00821283 -0.00513733 0.910597 47.0175 0.0138586 2212 10 700 MyCulture/Cell454
0.0285945 0.0294013 0.0294013 0.995583 48.106 0.07060.0704 0.07040704 My文化/ Cell614
0.0286381 0.0294304 0.994406 48.0697 0.0026054 2212 1 0 704 My文化/ Nucleus0
我申请了 natsortrows 函数从下面的链接 https://au.mathworks.com/matlabcentral/fileexchange/47433-natural-order-row-sort?focused=786f2c8e-3071-0689-f6d9-7bd6ab3378b9&tab=example 根据像这样的最后一列对行进行排序...
. .。. .MyCulture / Cell316
. .。. .MyCulture / Cell336
. .。. .MyCulture / Cell339
. .。. .MyCulture / Cell700
. .。. .MyCulture / Nucleus0
. .。. .MyCulture / Nucleus0
. .。. .MyCulture / Nucleus0
有没有办法对数据进行分组这样细胞核和细胞的数据就会根据它们的数量进行分组?所以像. .
MyCulture / Cell0
MyCulture / Cell0
MyCulture / Nucleus0
MyCulture / Cell3
MyCulture / Nucleus3
MyCulture / Cell50
MyCulture / Nucleus50
MyCulture / Nucleus50
等等……

接受的答案

Stephen Cobeldick
Stephen Cobeldick 2020年3月10日
c = {“MyCulture / Cell316”;“MyCulture / Cell0”;“MyCulture / Cell339”;“MyCulture / Cell0”;“MyCulture / Nucleus50”;'myculture / nucleus0';“MyCulture / Nucleus50”}
>> [~,X] = sort(str2double(regexp(C, X)))“\ d + $”,“一次”,“匹配”)));
b: = c (x);
给予:
> > D {:}
ans = MyCulture / Cell0
ans = MyCulture / Cell0
ans = MyCulture / Nucleus0
ans = myculture / nucleus50
ans = myculture / nucleus50
ans = MyCulture / Cell316
ans = MyCulture / Cell339

更多的答案(0)

标签

下载188bet金宝搏


释放

R2019A.

社区寻宝

在MATLAB中心找到宝藏,并发现社区可以如何帮助您!

开始狩猎!