How to create a corresponce between 2 column vector? (Replicating the vlookup funcion of excel)
Afficher commentaires plus anciens
Hi!
I have the next two vectors (all are numbers and type double)=
A=[1;2;3;4;5]
B=[30;40;50;60;70]
Lets say that the elements on B are a "correspondence" with the elements on A.
And I have another vector, C, which contains some of the elements that belongs to A.
C=[2,3,4]
I want to know how I can create a fourth vector, D, which associates those elements in B that are in the same possition than those in C. So I want to obtain:
D=[40;50;60]
How can I do this? In a matter of saying this I want to "replicate" the Vlookup function from excel.
Can anyone help me?
Thanks a lot!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Spreadsheets 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!