How to attribute a letter to unique combinaisons
Afficher commentaires plus anciens
Hi,
I have a very simple question that is a bit tricky to explain: I have a table like this
var_a = {'T1','T1','T1','T1','T1','T1','T2','T2','T2','T2','T2','T2','T2','T2'}';
var_b = [2,2,2,2,3,3,8,8,8,9,9,10,10,11]';
t = table(var_a, var_b)
and for every unique var_a id, I want every unique combinaison between var_a and var_b to be attributed a different letter beginning with 'A'. In other words the desired output would looks like this:
var_a = {'T1','T1','T1','T1','T1','T1','T2','T2','T2','T2','T2','T2','T2','T2'}';
var_b = [2,2,2,2,3,3,8,8,8,9,9,10,10,11]';
var_c = {'A', 'A', 'A', 'A', 'B', 'B', 'A', 'A', 'A', 'B', 'B', 'C', 'C', 'D'}';
desired_out_put = table(var_a, var_b, var_c)
Thank you,
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Software Development dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!