Associate the value to the correct string

2 visualizaciones (últimos 30 días)
gcicceri
gcicceri el 9 de Jul. de 2020
Editada: gcicceri el 9 de Jul. de 2020
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 comentario
Image Analyst
Image Analyst el 9 de Jul. de 2020
Editada: Image Analyst el 9 de Jul. de 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.

Iniciar sesión para comentar.

Respuestas (1)

gcicceri
gcicceri el 9 de Jul. de 2020
Editada: gcicceri el 9 de Jul. de 2020
I don't need to sort() the table, I just need to transfer the associated values of the column names to another table.
The table is the one you see. Also the result of how must be.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by