Info

此问题已关闭。 请重新打开它进行编辑或回答。

eliminate duplicate in a cell

2 次查看(过去 30 天)
ben zekri raouf
ben zekri raouf 2015-2-19
关闭: MATLAB Answer Bot 2021-8-20
Hi ,im asking if there is a way to eliminate the dublicate,so the result must be('eight two lions') .Any help is greatly appreciated.
>> a
a =
'الأسود إثنان' ('two lions')
>> b
b =
'الأسود ثمانية' ('eight lions')
>> class(a)
ans =
cell
>> class(b)
ans =
cell
>> strcat(b,{' '},a)
ans =
'الأسود ثمانية الأسود إثنان' ('eight lions two lions)
  2 个评论
Elias Gule
Elias Gule 2015-2-19
c = [a ' ' b]; c = unique(regexp([c{:}],'\s+','split'));
tmp = c(2); c(2) = c(3); c(3) = tmp;
ben zekri raouf
ben zekri raouf 2015-2-19
it works really good,thank you so much :)

回答(0 个)

此问题已关闭。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by