wcommon.m
上传用户:haiyisale
上传日期:2013-01-09
资源大小:3246k
文件大小:1k
- function [xind,yind] = wcommon(x,y)
- %WCOMMON Find common elements.
- % For two vectors X and Y with integer components,
- % [XI,YI] = WCOMMON(X,Y) returns two vectors
- % with 0 and 1 components such that:
- % XI(k) = 1 if X(k) belongs to Y otherwise XI(k) = 0 and
- % YI(j) = 1 if Y(j) belongs to X otherwise YI(j) = 0.
- % M. Misiti, Y. Misiti, G. Oppenheim, J.M. Poggi 01-May-96.
- % Last Revision: 14-May-2003.
- % Copyright 1995-2004 The MathWorks, Inc.
- % $Revision: 1.11.4.2 $
- xind = ismember(x,y);
- yind = ismember(y,x);