How to compare strings in a cell-array and sort them?
1 次查看(过去 30 天)
显示 更早的评论
These are 2 cell-array, respectively list={'a','b','c','a','e','f','g'}; and list_short={'a','b','c','a'}; that contains the first four elements of 'list'.
I would like to compare the element in 'list_short' and if two of them are equals (like 'a'), change the first of them with the fifth in 'list' and shift the six and seven as five and six and the removed 'a' as seven.
The two cell-array will be: list={'a','b','c','a','f','g','a'}; and list_short={'e','b','c','a'};
Thanks in advance!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!