'ismember' for cell arrays with various data types

版本 1.1 (2.1 KB) 作者: Wei-Rong Chen
'cellismember' is a function that performs 'ismember' on cell arrays with various data types
205.0 次下载
更新时间 2015/4/16

查看许可证

The built-in "ismember" function in MATLAB fails to perform when the input variables are cells containing different types of variables.
% This function 'cellismember' is a function that performs 'ismember' on
% cells with various data types.
% The input A and B must be cell arrays.
% Example:
% Input: A = {'ab','cd', NaN, [], 5, 1}; B = {[], 'cd', NaN, 1};
% output: Lia = [0 1 1 1 0 1];
%
% Acknowledgement:
% This function greatly benefits from Jan Simon's comments. The previous version was errorful.
% See 'ismember' for more information
% Weirong Chen Apr-16-2015

引用格式

Wei-Rong Chen (2024). 'ismember' for cell arrays with various data types (https://www.mathworks.com/matlabcentral/fileexchange/50474-ismember-for-cell-arrays-with-various-data-types), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Types 的更多信息
标签 添加标签

Community Treasure Hunt

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

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

Bug fixed.

1.0.0.0