Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想比较两列矩阵:比如
a=[1;2;2;3;4;4;5;6] b=[2;4;8]
并获得类似的输出
d=[0;1;1;0;1;1;0;0]
这是相同数量的矩阵行数a。
a
ismember正是您所需要的。尝试:
ismember
c=ismember(a,b)