uniqueCells
[ 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.
Citar como
Konrad (2024). uniqueCells (https://www.mathworks.com/matlabcentral/fileexchange/68449-uniquecells), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Etiquetas
Agradecimientos
Inspirado por: uniqueCellGeneralized(A), Unique Rows for a cell array, Unique elements in cell array
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.