length(unique(['A1';'A1';'A1';'A2';'A2';'B1';'B1';'B2';'B3'], 'rows'))
length(categories(categorical(cellstr(['A1';'A1';'A1';'A2';'A2';'B1';'B1';'B2';'B3']))))
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!