How to get score of each combination of pairs in each tool
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Mekala balaji
el 23 de Feb. de 2018
Comentada: Mekala balaji
el 27 de Feb. de 2018
Hi,
I have score of a different combination of recipe pairs in each tool, now I give available recipes and want to get the score of each possible combination of recipes in each tool,
Score_data:
Tool Pair Score
Tool1 AB 40
Tool1 AS 37
Tool1 AT 11
Tool1 SA 23
Tool1 ST 37
Tool1 TA 39
Tool1 TB 17
Tool1 BA 39
Tool2 BA 23
Tool2 BS 40
Tool2 BT 39
Tool2 SA 36
Tool2 ST 33
Tool2 AS 10
Tool3 AB 11
Tool3 AS 21
Tool3 AT 26
Tool3 BA 38
Tool3 BS 12
Tool3 BT 39
Tool3 ST 21
Tool3 TA 0
Tool4 AB 23
Tool4 BT 40
Tool4 SA 0
Tool4 TB 11
Tool4 AT 40
Tool4 BA 0
Tool4 BS 10
AB means: A-->B pair,AS means A-->S pair etc.
Now I want to get possible score of given recipes in each tool,
New_recipes:
A
B
S
T
D
N
My desired output: If any pair's score not available then it is NA in the desired output.
AB AS AT AD AN BA BS BT BD BN SA SB ST SD SN TA TB TD TN
Tool1 40 37 11 NA NA 39 NA NA NA NA 23 NA 37 NA NA 39 17 NA NA
Tool2 NA 10 NA NA NA 23 40 39 NA NA NA NA 33 NA NA NA 11 NA NA
Tool3 11 21 26 NA NA 38 12 39 NA NA 36 NA 21 NA NA 0 NA NA NA
Tool4 23 NA 40 NA NA 0 10 40 NA NA 0 NA NA NA NA NA NA NA NA
Many thnaks in advance,
0 comentarios
Respuesta aceptada
Guillaume
el 24 de Feb. de 2018
Editada: Guillaume
el 24 de Feb. de 2018
7 comentarios
Guillaume
el 26 de Feb. de 2018
Well, yes, you commented out the first line, which reads the file into a table. As I wrote in the first line of my answer:
"Very easily done if your data is in a table using unstack"
Get rid of the outdated xlsread and use readtable instead, as per my answer.
Más respuestas (0)
Ver también
Categorías
Más información sobre Tables en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!