Why does the unique() function give an unexpected extra output here?
이전 댓글 표시
I'm trying to find the unique elements inside a string array (attached, "datestrings_of_problem_times.mat").
When I run this (after loading "datestrings_of_problem_times.mat") ;
[datestrings_of_interest, indices, b] = unique(datestrings_of_problem_times);
The output "datestrings_of_interest" (attached, "datestrings_of_interest.mat") has an empty string ( [""] ) as its first element, but there are no empty strings inside my initial string array.
And, the output "indices" (attached, "indices") has 50877 as its first element. But, my string array has 50876 elements in the first place. So, the unique function somehow checked whether the 50877th element of a 50876x10 string array was unique or not. What am I missing / how could I fix this?

채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!