String Matching in an If Statement
2 次查看(过去 30 天)
显示 更早的评论
If I want to compare strings (2 tables) sequentially in an if statement, what command caters for this?
A logical array won't work as there are multiple strings to compare (differing in number between datasets) from the first array to the other.
Eg.
Table 1.
Col 1 has string names. Col 2 has set values of the double type for each string name.
Table 2.
Col 1 has strings to be matched. Col 2 has different values of the type double to be added.
Note: Col 2's strings are in random order.
0 个评论
回答(1 个)
Peter Jarosi
2019-7-23
I recommend reading more about it depending on your problem but something like this:
Table3 = outerjoin(Table1, Table2, 'Keys', {'Col1'});
2 个评论
Peter Jarosi
2019-7-23
Thank you Guillaume!
I think that Justin has to try different join functions with different options and investigate the result and one of these combinations may help.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!