vlookup fuction for matlab
6 次查看(过去 30 天)
显示 更早的评论
Greetings all,
I have table with a size 54 by 4 I need to use something equivalent to the vlookup(lookup val, table, column index) (i.e. vlookup(3.4,tableA,3) in matlab. would appreciate your help here :)
Thank you
0 个评论
采纳的回答
the cyclist
2017-4-9
Here is one way:
% The input matrix
M = magic(5);
% Input for element to find
elementToFind = 23;
colToReturn = 4;
% The algorithm
[tf,rowWithElement] = ismember(elementToFind,M(:,1));
output = M(rowWithElement,colToReturn);
更多回答(1 个)
the cyclist
2017-4-9
Someone has contributed this vlookup function to the File Exchange. I haven't used it myself, so I can't comment on how well it works.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!