Generate all possible subset from a character array in MATLAB
2 次查看(过去 30 天)
显示 更早的评论
I need to generate all possible subset from a character array with reduced execution time. Actual input is of length '500' characters and maximum length of subset is limited to 20 characters.
For example:
input='ABCA';
output ='A', 'B', 'C', 'AB', 'BC', 'CA', 'ABC', 'BCA', 'ABCA'
4 个评论
Walter Roberson
2019-3-30
Could you confirm that length(unique(input)) is 500? For example 500 Chinese ideographs? As opposed to length(input) being 500 but the number of unique being much smaller?
回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!