String Matching in an If Statement

조회 수: 1 (최근 30일)
Jay
Jay 2019년 7월 23일
댓글: Peter Jarosi 2019년 7월 23일
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.

답변 (1개)

Peter Jarosi
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
Guillaume
Guillaume 2019년 7월 23일
A plain join or an innerjoin might also be the answer. but I agree with Peter, you'r most likely looking at some sort of join.
Peter Jarosi
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 CenterFile Exchange에서 Tables에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by