From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Cell array
Date: Thu, 06 Mar 2014 00:24:23 -0600
Organization: NNTP Server
Lines: 27
Message-ID: <lf948g$1h2$>
References: <lf93c8$qqo$>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1
X-Notice: Filtered by postfilter v. 0.8.2
Xref: comp.soft-sys.matlab:810347

On 3/6/2014 12:08 AM, sudhakar wrote:
> I am having a cell array
> '511E7D7C:13,HEHDT,300.0,T*2C~0A'
> '511E7D7C:13,HEHDT,300.0,T*2C~0A'
> '511E7D7D:12,HEHDT,300.0,T*2C~0A'
> '511E7D7D:12,HEHDT,300.1,T*2D~0A'
> '511E7D7E:12,HEHDT,300.1,T*2D~0A'
> '511E7D7E:12,HEHDT,300.2,T*2E~0A'
> '511E7D7F:12,HEHDT,300.2,T*2E~0A'
> '511E7D7F:12,HEHDT,300.5,T*29~0A'
> Applying unique returns string if the string repeates twice or more.

No, not really.  unique() returns a list the length of which is the 
number of unique values found...a list of four elements each of which is 
different will return four outputs; no repeated values needed.  This may 
just be an English not primary language problem but figured worth 

> Now I want the output in such a way that if first part of the string
> repeats then output must be entire string. i.e,
> In the first two string the first part is common, then it should return
> only one string.

Use the length of the substring of interest as the argument.