Associate the value to the correct string
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi guys,
I have a (mxn) table:
table_1:
Date var_1 var_2 var_3 var_4
01-01-90 0.03 0 0.29 0
01-01-91 0.03 0.30 0.53 0.30
01-01-92 0.02 0.20 0.56 0.39
01-01-93 0.01 0.19 0.57 0.37
01-01-94 0.06 0.20 0.33 0.43
.........................................................................
.........................................................................
and a (mxn)string: (consider now the columns)
1 2 3
var_3 var_1 var_2
var_1 var_2 var_3
var_4 var_4 var_4
var_2 var_3 var_1
My question is:
how do I associate the value of next year (row) of the table_1 directly from the name of the string?
This should be the result:
table_3:
1 2 3
0.53 0.02 0.19
0.03 0.20 0.57
0.30 0.39 0.37
0.30 0.56 0.01
1 commentaire
Image Analyst
le 9 Juil 2020
Modifié(e) : Image Analyst
le 9 Juil 2020
Are you wanting to know how to use sort() on each table row independently? Like sort the table with the 'var_n' strings in it, and then reshuffle the table with the numbers to use the same sort order as you got from the table with the strings?
Make it easy for us to help you by supplying us with code to generate the string table and the numbers table.
Voir également
Catégories
En savoir plus sur Tables dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!