MATLAB: comparison of cell arrays of string

前端 未结 3 1220
星月不相逢
星月不相逢 2020-12-31 18:56

I have two cell arrays of strings, and I want to check if they contain the same strings (they do not have to be in the same order, nor do we know if they are of the same len

3条回答
  •  天命终不由人
    2020-12-31 19:38

    Take a look at the function intersect

    What MATLAB Help says:

    [c, ia, ib] = intersect(a, b) also returns column index vectors ia and ib such that c = a(ia) and b(ib) (or c = a(ia,:) and b(ib,:)).

提交回复
热议问题