MEMBERSHIP

版本 1.0.0.0 (595 字节) 作者: Mukhtar Ullah
Membership of elements of one array in another.
1.8K 次下载
更新时间 2005/6/7

无许可证

MEMBERSHIP counts membership of elements of one array in another.

C = MEMBERSHIP(A,B) for the array A returns an array of the same size as A containing the number of instances of the elements of A in the array B. A and B can be character arrays or cell arrays of strings.

Examples:
membership(1:6,pascal(3)) returns [5 1 2 0 0 1]
membership('MASK','MISSISSIPI') retruns [1 0 4 0]
membership({'john','gul';'sim','ku'},{'sim','gul','kid','gul'}) returns
[0 2;1 0]

See also FREQTABLE, ISMEMBER

引用格式

Mukhtar Ullah (2024). MEMBERSHIP (https://www.mathworks.com/matlabcentral/fileexchange/7796-membership), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R14
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Characters and Strings 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0

a check included