countmember

Version 2.1 (1,87 ko) par Jos (10584)
Count members.
6,2K téléchargements
Mise à jour 20 jan. 2019

Afficher la licence

Note de l’éditeur : This file was selected as MATLAB Central Pick of the Week

C = COUNTMEMBER(A,B) counts the number of times the elements of array A are present in array B, so that C(k) equals the number of occurences of A(k) in B. A may contain non-unique elements. C will have the same size as A.
A and B should be of the same type, and can be cell array of strings.

Examples:
countmember([1 2 1 3],[1 2 2 2 2])
-> 1 4 1 0
countmember({'a','b','c'},{'a','x','a'})
-> 2 0 0

Citation pour cette source

Jos (10584) (2024). countmember (https://www.mathworks.com/matlabcentral/fileexchange/7738-countmember), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2018b
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Characters and Strings dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
2.1

using histcounts now

2.0.0.0

updated from R13

1.1.0.0

improved help and comments, fixed some spelling issues

1.0.0.0

Reduced overhead by removing unnecessary dummy variables.