Finding unique set from large dataset
1 次查看(过去 30 天)
显示 更早的评论
Hello!
How would one go about to find a unique set of variables that can depict shortly which variables are used in a large dataset using a matlab code?
For example if the english dictionary is my large dataset, I want the output to be the 26 alphabets-saying these are the unique variables used in your large dataset.
Another example
If x = {"abc", "bcd", "ded"}
I want the output as {"a","b","c","d","e"}
Thanks in advance!
0 个评论
采纳的回答
madhan ravi
2019-7-18
a = cellfun(@(z)regexp(z,'.','match'),x,'un',0);
Output = num2cell(unique([a{:}]))
5 个评论
更多回答(2 个)
Waqar Ali Memon
2019-7-18
Bruno Luong
2019-7-18
编辑:Bruno Luong
2019-7-18
x = ["abc", "bcd", "ded"] % no need using curly bracket for strings
string(unique(cat(2,x{:}))')'
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!