eliminate duplicate in a cell

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 Comments

c = [a ' ' b]; c = unique(regexp([c{:}],'\s+','split'));
tmp = c(2); c(2) = c(3); c(3) = tmp;
it works really good,thank you so much :)

Answers (0)

This question is closed.

Asked:

on 19 Feb 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!