manipulate table containing numeric and string

1 Ansicht (letzte 30 Tage)
Khairul Nur
Khairul Nur am 5 Aug. 2021
Kommentiert: Khairul Nur am 5 Aug. 2021
hi, i have a table containing numeric and string as follow:
crisp_distance_per_cluster1 crisp_distance_per_cluster2 Var3
___________________________ ___________________________ _______________
1 2.3904 'dummy_data_1'
1 2.5404 'dummy_data_2'
1 1.5547 'dummy_data_3'
1 0.92612 'dummy_data_4'
1 1.0761 'dummy_data_5'
1 2.1333 'dummy_data_6'
1 1.2761 'dummy_data_7'
2 7.0547 'dummy_data_8'
2 7.8476 'dummy_data_9'
2 9.1404 'dummy_data_10'
2 9.9047 'dummy_data_11'
I want to split the table into different table based on the crisp_distance_per_cluster1. For example, if crisp_distance_per_cluster1=1, will be
1 2.3904 'dummy_data_1'
1 2.5404 'dummy_data_2'
1 1.5547 'dummy_data_3'
1 0.92612 'dummy_data_4'
1 1.0761 'dummy_data_5'
1 2.1333 'dummy_data_6'
1 1.2761 'dummy_data_7'
I dont want to convert the table into string since later i need to do some numerical calculation. Please help to give suggestion, ideas or code. TQIA.

Akzeptierte Antwort

KSSV
KSSV am 5 Aug. 2021
If T is your table...
T1 = T(T.(1)==1,:)

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by