Lookup values in other matrix
Show older comments
I have two very large vectors of the same size:
Vector 1 contains a list of type
Type ("Math","Chem","Bio")
["Math" "Chem" "Bio" "Chem" "Chem" "Math" ...]
Vector 2 contains a different list of types
Type ("Baseball","Tennis","Soccer")
["Baseball" "Tennis" "Soccer" "Tennis" "Tennis" "Baseball" ...]
I have another small matrix with numeric values associated with each combination of the two types:
"Math" "Baseball" 5
"Math" "Tennis" 8
"Chem" "Baseball" 16
.....
I would like to create a new vector to lookup base on the matrix for the numeric value. What would be the vectorized way to deal with this situation? Seems like a very common task, but I couldn't figure it out.
Thanks in advance, Fischer
Accepted Answer
More Answers (0)
Categories
Find more on Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!