How to create a corresponce between 2 column vector? (Replicating the vlookup funcion of excel)
1 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!