uniqueCells

版本 1.2.1 (2.0 KB) 作者: Konrad
Implementation of unique for ND cell arrays of mixed type. Avoids num2str and provides switches for unique rows and to treat NaNs as equal.
40.0 次下载
更新时间 2018/8/13

查看许可证

[ outcell, iIn, iOut ] = uniqueCells( incell [, 'rows', 'equalnan'] )

Usage is similar to unique().
The 'rows' switch returns unique rows in a matrix of cells. Otherwise, ND cell arrays are supported.
The 'equalnan' switch treats NaNs as equal.

As sorting is not possible for mixed-type cells the output corresponds to
the 'stable' switch in unique(). The occurrence-switch of unique() is NOT
implemented.

The following is true (w/o the 'rows' switch'):
isequal(incell(iIn), outcell)
isequal(outcell(iOut), incell)

Using the 'rows' switch:
isequal(incell(iIn,:), outcell)
isequal(outcell(iOut,:), incell)

The algorithm performs exhaustive pairwise comparisons using isequal
making it exact and type-independent (in contrast to implementations
using num2str); however this may come at the expense of performance.

引用格式

Konrad (2024). uniqueCells (https://www.mathworks.com/matlabcentral/fileexchange/68449-uniquecells), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2017a
与 R2007b 及更高版本兼容
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Data Type Identification 的更多信息

Community Treasure Hunt

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

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

Fixed typo.

1.2.0

Input checking, error handling & compatibility improved.

1.1.0