Unique for cell array of string

版本 1.1.0.0 (1.0 KB) 作者: Wei-Rong Chen
This function 'uniqueStrCell' performs 'unique' for cell array of string.
755.0 次下载
更新时间 2015/4/14

查看许可证

The built-in 'UNIQUE' function in MATLAB will report errors if the input cell contains different types of variables.
% This function 'uniqueStrCell' performs 'UNIQUE' for cell array of string.
% The output cell 'out' will include only string cells and numeric cells converted to strings
% , and exclude NaN and empty cells.
% Example:
% inputStrCell={'ek','wekf', 29, NaN, [],'we'};
% out = uniqueStrCell(inputStrCell);
% >> out = {'ek' 'we' 'wekf' '29'}
%
% Acknowledgement:
% This function greatly benefits from Jan Simon's comments. The previous version was errorful.
% See 'unique' for more information

引用格式

Wei-Rong Chen (2024). Unique for cell array of string (https://www.mathworks.com/matlabcentral/fileexchange/50476-unique-for-cell-array-of-string), MATLAB Central File Exchange. 检索来源 .

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

Community Treasure Hunt

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

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

Update greatly benefits from Jan Simon's comments.

1.0.0.0